markdown-toc
markdown-toc copied to clipboard
Ignore links in headings
When using the script with keep-a-changelog, the links are generated wrong.
The links render fine:

The target is wrong: E.g., "unreleased" points to https://github.com/olivierlacan/keep-a-changelog/compare/v0.3.0...HEAD instead of #unreleased
I assume that simply the the link brackets ( []) have to be removed from the output. E.g., [[Unreleased]](#unreleased) has to be [Unreleased](#unreleased)
The complete example is available at https://github.com/koppor/keep-a-changelog/blob/master/CHANGELOG.md
You can use the slugify option to remove the [ ] from the headings.
hmm, I use this with our changelogs and the headings always seem to work. Maybe the [] is indeed causing the issue.
I'll look into it and see what's happening
I checked again today on Win 10:
npm install --save markdown-tocnode_modules\.bin\markdown-toc -i CHANGELOG.md- Same result as above.
@doowb I cannot use slugify, because I am using the CLI
Sorry for taking so long, I just wasn't sure how to handle this. How about if we just expose a --slugify flag or something?
@koppor all of the command line arguments are passed as options now. slugify takes a function which cannot be passed via the command line, but you can pass false. Try that to see if it works for you. This is just a work-around but it might be useful for you.
markdown-toc -i CHANGELOG.md --slugify false