showdownjs / showdown

A bidirectional Markdown to HTML to Markdown converter written in Javascript
http://www.showdownjs.com/
MIT License
14.34k stars 1.57k forks source link

Allow not making header ids lowercase #567

Open peci1 opened 6 years ago

peci1 commented 6 years ago

Code in https://github.com/showdownjs/showdown/blob/develop/src/subParsers/makehtml/headers.js#L95 and following lines always applies toLowerCase() to the header ID.

I'd like to have an option to not make the IDs lowercase (as some tools, e.g. Boostnote, do not change case of the header IDs).

tivie commented 6 years ago

We do lower case comparisons because some mobile browsers and older browsers, ids are case insensitive. So, in order to prevent id duplication (and weird issues), we lower case the id attribute value.

Also, Github, and most markdown implementations lowercase generated ids

peci1 commented 6 years ago

I agree that comparing case-insensitive by default is a good idea. However, in my use-case, I need the case-sensitive IDs, thus I'm asking for having an option to turn off the conversion to lowercase.