Headings should generate ids for deep-linking
See original GitHub issueSubject of the feature
Add ids to headings for deep linking.
Problem
Most markdown implementations automatically add a slugified id to all headings (h1–h6) for deep-linking support. I would expect MDX to do the same.
Expected behavior
Markdown such as ## More information
should render as <h2 id="more-information">More information</h2>
. This way, links with this hash deep link to the heading (e.g. https://example.com/foo#more-information).
Alternatives
Similar behavior can be accomplished by creating custom components that add the id, but this requires additional configuration.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Feature request: automatically generated ids for headers
All it needs to do is generate unique-in-the-document fragment IDs, and I suppose it would be nice (but not strictly necessary, because you...
Read more >Does Device ID Coverage Matter for Deep Links?
There is one way to use device IDs for deep linking: tie them to persistent, anonymous identifiers on the web. In other words,...
Read more >Deep linking in 2022: Everything you need to know - AppsFlyer
Deep linking doesn't have to be confusing! Find out all you need to know with this new, comprehensive deep linking guide.
Read more >Deep linking | Roku Developer
Public channels with video content must implement deep linking to pass ... Separate contentIDs used to identify the season and series of the...
Read more >Link to a heading within a post or topic - users - Discourse Meta
In very long posts, it can be helpful to structure the text with headings that make it more readable. This also allows users...
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
Yeah, I think we shouldn’t do this by default in MDX since it’s pretty opinionated, but we should definitely document this in the guides.
There’s a rehype plugin for that! rehype-slug. Read more about plugins here: https://mdxjs.com/advanced/plugins