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

mdx codeblocks metadata doesn't apply changes #5163

Closed
1 task
kevinzunigacuellar opened this issue Oct 21, 2022 · 3 comments · Fixed by #5335
Closed
1 task

mdx codeblocks metadata doesn't apply changes #5163

kevinzunigacuellar opened this issue Oct 21, 2022 · 3 comments · Fixed by #5335
Assignees
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)

Comments

@kevinzunigacuellar
Copy link
Member

What version of astro are you using?

1.5.2

Are you using an SSR adapter? If so, which one?

No

What package manager are you using?

npm

What operating system are you using?

Mac

Describe the Bug

following #4447

Tested with @astrojs/mdx": "^0.11.4", it still happens

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-zra7nk?file=package.json

Participation

  • I am willing to submit a pull request for this issue.
@matthewp matthewp added the - P4: important Violate documented behavior or significantly impacts performance (priority) label Oct 28, 2022
@bluwy
Copy link
Member

bluwy commented Nov 9, 2022

Looks like we need rehype-raw to prevent a breaking change for existing user rehype plugins. But rehype-raw strips out the node data intentionally (syntax-tree/hast-util-raw#13). Trying to write a rehype plugin to preserve it for code tagNames.

@bluwy
Copy link
Member

bluwy commented Nov 9, 2022

#5335 should fix this with an alternative approach. Rehydrating the data field requires double hast tree traversal regardless if you use a code block or not, so it doesn't feel worth the effort. The PR should be much simpler.

@kevinzunigacuellar
Copy link
Member Author

Thank you @bluwy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants