-
-
Notifications
You must be signed in to change notification settings - Fork 382
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(rehype): support inline codes #751
Conversation
✅ Deploy Preview for shiki-next ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for shiki-matsu ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Using the proposed syntax |
Is this just for |
It doesn't work with transformers, I would just suggest to use code blocks if you want to use them. |
Why not making it work? Using code blocks for inline code isn't really an option. |
It should be discussed in a separate issue with enough details on how transformers can be re-implemented for inline codes, and it makes no sense to use transformers like line highlight, focus on an inline code. Twoslash, notation transformers cannot even work without multiline code blocks, I'd say it's probably useless and further discussion is needed. For now, it's better to avoid changes on transformer API |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #751 +/- ##
==========================================
+ Coverage 94.52% 94.58% +0.05%
==========================================
Files 64 65 +1
Lines 3874 3931 +57
Branches 859 870 +11
==========================================
+ Hits 3662 3718 +56
- Misses 207 208 +1
Partials 5 5 ☔ View full report in Codecov by Sentry. |
I use I don't understand the point about avoiding changes on transformer API being better. That's my point exactly. There's nothing special about inline code. |
Because this PR is about the Rehype integration of Shiki, you can also contribute by opening a PR. |
Description
Support to highlight inline codes with
code{:language}
syntax.It isn't enabled by default to avoid problems when people upgrading from older versions of Shiki.
The output is basically same as normal code blocks but with
pre
replaced by aspan
element.Linked Issues
#660
Additional context
Should we give additional information to transformers, or allow to pass different options for inline code highlighting?