vue-markdown icon indicating copy to clipboard operation
vue-markdown copied to clipboard

Heading IDs

Open Radiergummi opened this issue 6 years ago • 3 comments

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.

Radiergummi avatar May 28 '19 09:05 Radiergummi

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?

Radiergummi avatar May 28 '19 09:05 Radiergummi

https://www.markdownguide.org/extended-syntax/#heading-ids

dominik-korsa avatar Nov 06 '19 14:11 dominik-korsa

@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.

Radiergummi avatar Nov 22 '19 08:11 Radiergummi