Closed suuminbot closed 8 years ago
This is actually by design. The HTML5 spec permits any characters to be used in the ID, except for spaces. This plugin follows that spec.
If some other piece of code does not handle the HTML5 spec for IDs properly, you need to fix that code, or let the author of that code know.
I see. Thanks for the information. I'll check other one too. BY the way, I really appreciate this plugin. It's simple and easy to use. Thanks for sharing this code!
Thank you for the appreciation! Happy to know that the plugin helped you.
If heading includes non-word character, automatic IDs also includes these character.
For example, if I write heading like this.
# hello?
Then, ID will be like this.<h1 id="hello?">hello?</h1>
If ID includes non-word character especially "?", some errors occur when I use other plugin.How about to change regular expressions like this?
var baseId = text.replace(/\s|[?]/g, "_"), suffix = "", count = 1;