MDXv2 broken with remark-heading-id
See original GitHub issueInitial checklist
- I read the support docs
- I read the contributing guide
- I agree to follow the code of conduct
- I searched issues and couldn’t find anything (or linked relevant results below)
Affected packages and versions
2.0.0
Link to runnable example
No response
Steps to reproduce
- Install & import
remark-heading-id
- in MDX remarkPlugins, add remark-heading-id
- Try to parse MDX:
## foo {#heading}
Expected behavior
The plugin handles the {#...}
extended markup syntax, and MDX parses the document normally
Actual behavior
Get error: Could not parse expression with acorn: Unexpected character '#'
It makes sense that MDX thinks that {...}
syntax is inline JS, but I would have thought plugins can be used to support heading ID Markdown extended syntax.
Runtime
Node v16
Package manager
npm v8
OS
Windows
Build and bundle tools
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Mdx-Js Mdx Issues - IssueHint
MDXv2 broken with remark-heading-id, closed, 7, 2022-02-26, 2022-12-13. Disable nested markdown via configuration, closed, 2, 2022-02-23, 2022-12-13 ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for all the pointers! ended up making a separate package: remark-custom-heading-id. The micromark code is substantially different than the
unist-util-visit
-based approach, and the old extension is still good-enough for non-MDX cases.I’d say thank you so much @Eyas that repo helped me a lot.