You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I searched issues and couldn’t find anything (or linked relevant results below)
Problem
I like generating dynamic ids for my headings to build tables of content, that's so cool.
I'm missing a valid MDX syntax to include an id for a heading.
Solution
But I miss a feature where I could add a custom id for a heading. Many Markdown parsers support this syntax for custom id:
## Heading hello {#custom-id}
which can be then rendered into
<h2 id="custom-id">Heading hello</h2>
Alternatives
Currently, you could achieve something similar by adding a link to a heading
## [Heading hello](#custom-id)
but that's really an id of a link, not a heading. And it adds a link where it's not actually necessary. It's just a somewhat compliant syntax, to include any id in any form, with the implication of it being parsed with the intention of the link id being turned into the heading id.
Another alternative could be just using HTML all the time, instead of .mdx
<h2 id="custom-id">Heading</h2>
but if I wanted to do that, I would just write React, not .mdx.
The text was updated successfully, but these errors were encountered:
Initial checklist
Problem
I like generating dynamic
id
s for my headings to build tables of content, that's so cool.I'm missing a valid MDX syntax to include an
id
for a heading.Solution
But I miss a feature where I could add a custom
id
for a heading. Many Markdown parsers support this syntax for custom id:which can be then rendered into
Alternatives
Currently, you could achieve something similar by adding a link to a heading
but that's really an
id
of a link, not a heading. And it adds a link where it's not actually necessary. It's just a somewhat compliant syntax, to include anyid
in any form, with the implication of it being parsed with the intention of the linkid
being turned into the headingid
.Another alternative could be just using HTML all the time, instead of
.mdx
but if I wanted to do that, I would just write
React
, not.mdx
.The text was updated successfully, but these errors were encountered: