-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[MDX] Switch from Shiki Twoslash -> Astro Markdown highlighter #4292
Conversation
🦋 Changeset detectedLatest commit: 67669ec The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had a test-related nit, but other than that, LGTM.
02c3cf3
to
67669ec
Compare
Bu-bu-but why? I like Twoslash!
We do too! Still, we've noticed a fair share of MDX + Shiki-twoslash issues being reported due to inconsistencies with Markdown. Namely:
markdown.shikiConfig
(which could involve breaking changes to resolve) Validation is preventing me from using shikiConfig.themes #4245class="shiki"
while Markdown generatesclass="astro-code"
Due to this, we think bundling Twoslash by default has more cons than pros. We also don't feel we can migrate Markdown to Twoslash now that we've reached 1.0 stability.
Can I still use Twoslash?
Absolutely! If you like Shiki-twoslash, you can flip off our built-in highlighter and apply their remark plugin like so:
Changes
rehypeRaw
plugin. This makes custom syntax highlighters easier to apply, and is consistent with our Markdown defaults.Testing
Docs
Add "custom highlighter" section to README