Closed holtwick closed 3 years ago
You should be able to use markdown-it-attrs for this (make sure to load it before markdown-it-anchor)!
markdown-it-anchor is designed to reuse an existing id
attribute if there's any, so it will only add an id
to the titles that don't have one yet.
Let me know if that helps!
This is exactly what I was looking for! Thanks a lot, you made my day. It is even better than my previous solution ;)
You should consider adding this hint to the README.
In my headings I define the anchor name like this:
Becomes something like:
This is a common pattern in multiple Markdown flavors.
The benefit for me is, that I can use the same anchors for various translations of my help texts.
Any chance to support this? Thanks.