I'm giving my headings custom ids via the plugin markdown-it-attrs so that they stay the same, even if I change the text. Helpful for evergreen-content like FAQs etc.:
# FAQ
## What does it cost? {#price}
Unfortunately, slugify() only receives the text content as parameter, not the id of the heading. So, there's no way to override this as far as I can see. Expected output: should use #price as link target. Actual output: #what-does-it-cost
I think the code that searches for heading tokens should also look for 'headings_open' and check if there is an id-attribute and use this as a slug.
I'm giving my headings custom ids via the plugin
markdown-it-attrs
so that they stay the same, even if I change the text. Helpful for evergreen-content like FAQs etc.:Unfortunately,
slugify()
only receives the text content as parameter, not the id of the heading. So, there's no way to override this as far as I can see. Expected output: should use#price
as link target. Actual output:#what-does-it-cost
I think the code that searches for heading tokens should also look for 'headings_open' and check if there is an id-attribute and use this as a slug.