Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow nested decorations which share an 'edge' with parent #911

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

ms264556
Copy link
Contributor

@ms264556 ms264556 commented Jan 28, 2025

Description

Fixes for nested decorations which share a start or end. You can currently share a start and end, or share neither.

If start is shared, e.g. [{ start: 6, end: 10 }, { start: 6, end; 9 }], then you receive an end index error:-
ShikiError: Failed to find end index for decoration {"line":0,"character":9,"offset":9}

If end is shared, e.g. [{ start: 6, end: 10 }, { start: 7, end; 10 }], then you receive an intersection error:-
ShikiError: Decorations {"line":0,"character":6,"offset":6} and {"line":0,"character":7,"offset":7} intersect.

Linked Issues

#910

Additional context

Copy link

netlify bot commented Jan 28, 2025

Deploy Preview for shiki-matsu ready!

Name Link
🔨 Latest commit 6d58904
🔍 Latest deploy log https://app.netlify.com/sites/shiki-matsu/deploys/6799647e5b74440008a7fe91
😎 Deploy Preview https://deploy-preview-911--shiki-matsu.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jan 28, 2025

Deploy Preview for shiki-next ready!

Name Link
🔨 Latest commit 6d58904
🔍 Latest deploy log https://app.netlify.com/sites/shiki-next/deploys/6799647e804a200008e6aa5f
😎 Deploy Preview https://deploy-preview-911--shiki-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@antfu antfu changed the title Allow nested decorations which share an 'edge' with parent feat: allow nested decorations which share an 'edge' with parent Jan 30, 2025
@antfu antfu merged commit 482ad2d into shikijs:main Jan 30, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants