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

Preserve code element node meta for rehype syntax highlighters #5335

Merged
merged 1 commit into from
Nov 9, 2022

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Nov 9, 2022

Changes

Fix #5163

Support rehype-pretty-code by moving data.meta to properties.metastring as rehype-pretty-code accepts that: https://github.com/atomiks/rehype-pretty-code/blob/17e2856c5abe91eefc0830a8b5f8cab9d13aedb5/src/index.js#L151

Note this does not create a new metastring HTML attribute through testing.

Testing

Added a test for rehype-pretty-code

Docs

N/A. The plugin should work ootb now.

@changeset-bot
Copy link

changeset-bot bot commented Nov 9, 2022

🦋 Changeset detected

Latest commit: abe9228

The changes in this PR will be included in the next version bump.

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

@github-actions github-actions bot added the pkg: integration Related to any renderer integration (scope) label Nov 9, 2022
@matthewp matthewp merged commit dca762c into main Nov 9, 2022
@matthewp matthewp deleted the rehype-raw-fix branch November 9, 2022 13:32
@astrobot-houston astrobot-houston mentioned this pull request Nov 9, 2022
@@ -39,6 +39,7 @@
"github-slugger": "^1.4.0",
"gray-matter": "^4.0.3",
"kleur": "^4.1.4",
"rehype-pretty-code": "^0.4.0",
Copy link
Member

Choose a reason for hiding this comment

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

Should this have been a dev dependency as it’s only used in the test?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh right. I used the wrong install command. Fixing this now, thanks for catching this! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: integration Related to any renderer integration (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mdx codeblocks metadata doesn't apply changes
3 participants