Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't respect custom heading ids from markdown-it-attrs / no way to define custom ids #54

Closed
cmaas opened this issue Mar 8, 2021 · 0 comments · May be fixed by X-oss-byte/vscode-hackmd#29 or tanaysethi/https-github.com-vuejs-vuepress#6

Comments

@cmaas
Copy link
Owner

cmaas commented Mar 8, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant