Skip to content

feat: use shikiji for more accurate highlight #190

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

Merged
merged 1 commit into from
Dec 21, 2023
Merged

Conversation

antfu
Copy link
Member

@antfu antfu commented Dec 16, 2023

A few advantages:

  • More accurate highlight result
    • Shikiji supports grammar injections, which means it allows Vue grammar to inject rules into HTML grammar, and have it understand Vue interoperation in the template (previously treated as plain texts)
  • Reuse all themes Shikiji/TextMate supports (hard-coded in this PR)
  • Shikiji's syntax always keeps up to date with vuejs/language-tools
  • Possible to share the shikiji highlighter if it also been used by other parts of the app.

Before:
Screenshot 2023-12-16 at 06 24 47

After:
Screenshot 2023-12-16 at 06 24 19

Copy link

vercel bot commented Dec 16, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
repl ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 16, 2023 6:16am

Copy link
Member

@sxzz sxzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sxzz sxzz requested a review from johnsoncodehk December 16, 2023 06:37
@sxzz sxzz merged commit e79aa1a into vuejs:main Dec 21, 2023
@antfu antfu deleted the feat/shikiji branch December 21, 2023 15:04
oumoussa98 pushed a commit to vuetifyjs/vue-repl that referenced this pull request Apr 18, 2025
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.

3 participants