vue-markdown
vue-markdown copied to clipboard
Heading IDs
Is there any way to enable heading IDs you can link to? GitHub does this, for instance, by creating a slug from the heading content and putting it into the id attribute of the heading tag. So, the following heading:
### This is a headline
would be converted to
<h3 id="this-is-a-headline">This is a headline</h3>
This is immensely useful, especially for longer text or documentation.
After looking at markdown-it, there appears to be a plugin available on npm that does just this: https://www.npmjs.com/package/markdown-it-anchor
I guess I could create a PR tomorrow, if you'd be interested?
https://www.markdownguide.org/extended-syntax/#heading-ids
@dominik-korsa what exactly do you want to tell me..? Yes, the link you pasted without any context shows the syntax I described above. This library currently lacks the capability to do this, hence I opened an issue.
I don't get your comment.