question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MDXv2 broken with remark-heading-id

See original GitHub issue

Initial checklist

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:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

8reactions
Eyascommented, Mar 7, 2022

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.

1reaction
rikusen0335commented, Nov 29, 2022

I’d say thank you so much @Eyas that repo helped me a lot.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found