gitbook
gitbook copied to clipboard
Problems in heading id generation
The custom heading rendering in the renderer adds id attributes to headings. That's what it adds (after it adds the prefix):
raw.toLowerCase().replace(/[^\w -]+/g, '').replace(/ /g, '-');
The problems:
\wmatches only ASCII characters in JS. What about other languages?- Not only hyphens might be in headings, but also dashes (en dashes).
My suggestion is to change the first replace from [^\w -] to something like [,;].
Any comments?
I think you're right, Can you please do a PR for this ;)