markdown-toc icon indicating copy to clipboard operation
markdown-toc copied to clipboard

Add support of ß (a German letter)

Open 271289 opened this issue 5 years ago • 1 comments

Behavior

My headline "Preußen" results in the link [Preußen](#preuen).

Background information

The letter "ß" is used very often in German.

Solution

Change

hash = hash.replace /[^a-z0-9\u4e00-\u9fa5äüö\-]/g, ""

to

hash = hash.replace /[^a-z0-9\u4e00-\u9fa5äüö\u00df\-]/g, ""

Explanation

ß has the character code \u00df.

271289 avatar Apr 01 '20 11:04 271289

Even simpler... hash = hash.replace /[^a-z0-9\u4e00-\u9fa5äüöß\-]/g, ""

271289 avatar Apr 01 '20 14:04 271289