mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
fix(subParsers): strip international punctuation from github headers (#950)
This commit is contained in:
parent
e4c87cf5d5
commit
4333646c8c
|
@ -140,7 +140,7 @@ showdown.subParser('makehtml.heading.id', function (m, options, globals) {
|
|||
.replace(/¨D/g, '')
|
||||
// replace rest of the chars (&~$ are repeated as they might have been escaped)
|
||||
// borrowed from github's redcarpet (so they should produce similar results)
|
||||
.replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g, '')
|
||||
.replace(/[&+$,\/:;=?@"#{}|^¨¿?:~\[\]`、゠=…‥『』〝〟「」゠=…‥\\*(){}()[]【】%.。,¡!!'<>]/g, '')
|
||||
.toLowerCase();
|
||||
} else if (options.rawHeaderId) {
|
||||
title = title
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<h1 id="some-header">some header</h1>
|
||||
<h1 id="some-header-with--chars">some header with &+$,/:;=?@\"#{}|^~[]`\*()%.!' chars</h1>
|
||||
<h1 id="some-header-with--chars">some header with &+$,/:;=?@\"#{}|^¨¿?:~[]`゠=…‥『』〝〟「」\*(){}()[]【】%.。,¡!!' chars</h1>
|
||||
<h1 id="another-header--with--chars">another header > with < chars</h1>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# some header
|
||||
|
||||
# some header with &+$,/:;=?@\"#{}|^~[]`\\*()%.!' chars
|
||||
# some header with &+$,/:;=?@\"#{}|^¨¿?:~[]`゠=…‥『』〝〟「」\\*(){}()[]【】%.。,¡!!' chars
|
||||
|
||||
# another header > with < chars
|
||||
|
|
Loading…
Reference in New Issue
Block a user