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.

Headings should generate ids for deep-linking

See original GitHub issue

Subject 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:closed
  • Created 4 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
johnocommented, Oct 12, 2019

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.

4reactions
wooormcommented, Oct 12, 2019

There’s a rehype plugin for that! rehype-slug. Read more about plugins here: https://mdxjs.com/advanced/plugins

Read more comments on GitHub >

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

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