|
@@ -25,7 +25,7 @@ function getDefaultOpts(simple) {
|
|
},
|
|
},
|
|
ghCompatibleHeaderId: {
|
|
ghCompatibleHeaderId: {
|
|
defaultValue: false,
|
|
defaultValue: false,
|
|
- describe: 'Generate header ids compatible with github style (spaces are replaced with dashes, &~$!@#*()=:/,;?+\'. chars are removed)',
|
|
|
|
|
|
+ describe: 'Generate header ids compatible with github style (spaces are replaced with dashes, &~$!@#*()=:/,;?+%\\\'. chars are removed)',
|
|
type: 'string'
|
|
type: 'string'
|
|
},
|
|
},
|
|
headerLevelStart: {
|
|
headerLevelStart: {
|
|
@@ -1850,7 +1850,7 @@ showdown.subParser('headers', function (text, options, globals) {
|
|
.replace(/~T/g, '')
|
|
.replace(/~T/g, '')
|
|
.replace(/~D/g, '')
|
|
.replace(/~D/g, '')
|
|
//replace rest of the chars (&~$ are repeated as they might have been escaped)
|
|
//replace rest of the chars (&~$ are repeated as they might have been escaped)
|
|
- .replace(/[&~$!@#*()=:/,;?+'.\\]/g, '')
|
|
|
|
|
|
+ .replace(/[&~$!@#*()=:/,;?+'.%\\]/g, '')
|
|
.toLowerCase();
|
|
.toLowerCase();
|
|
} else {
|
|
} else {
|
|
escapedId = m.replace(/[^\w]/g, '').toLowerCase();
|
|
escapedId = m.replace(/[^\w]/g, '').toLowerCase();
|