markdown-toc
markdown-toc copied to clipboard
Invalid hashes for headers that differ only in not alphanumeric characters
See https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md with TOC autogenarated by the markdown-toc
.
Compare the links for:
page.$(selector) page.$$(selector)
page.$$eval(selector, pageFunction[, ...args]) page.$eval(selector, pageFunction[, ...args])
frame.$(selector) frame.$$(selector)
frame.$$eval(selector, pageFunction[, ...args]) frame.$eval(selector, pageFunction[, ...args])
elementHandle.$(selector) elementHandle.$$(selector)
GitHub generates the second id for such pairs by adding -1
to it.
Thanks for the issue!
I think I see how this can be fixed. We need to either get the title ('getTitle') or slugify
without the num
option first, then check to see if the result matches another header that we've already seen. Then slugify
again with the num
option set.
I'll try to get a PR together tonight unless someone else gets to it first.