Forráskód Böngészése

fix(ghCompatibleHeaderId): add % as an escaped char

Estevao Soares dos Santos 8 éve
szülő
commit
3102615ec2

+ 1 - 1
README.md

@@ -189,7 +189,7 @@ var defaultOptions = showdown.getDefaultOptions();
 
  * **noHeaderId**: (boolean) [default false] Disable the automatic generation of header ids. Setting to true overrides **prefixHeaderId**
 
- * **ghCompatibleHeaderId**: (boolean) [default false] Generate header ids compatible with github style (spaces are replaced with dashes, ][&~$!@#*()=:/,;?+'.\ chars are removed
+ * **ghCompatibleHeaderId**: (boolean) [default false] Generate header ids compatible with github style (spaces are replaced with dashes, ][&~$!@#*()=:/,;?+'.%\ chars are removed
 
  * **prefixHeaderId**: (string/boolean) [default false] Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to `true` will add a generic 'section' prefix.
  

+ 2 - 2
dist/showdown.js

@@ -25,7 +25,7 @@ function getDefaultOpts(simple) {
     },
     ghCompatibleHeaderId: {
       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'
     },
     headerLevelStart: {
@@ -1850,7 +1850,7 @@ showdown.subParser('headers', function (text, options, globals) {
         .replace(/~T/g, '')
         .replace(/~D/g, '')
         //replace rest of the chars (&~$ are repeated as they might have been escaped)
-        .replace(/[&~$!@#*()=:/,;?+'.\\]/g, '')
+        .replace(/[&~$!@#*()=:/,;?+'.%\\]/g, '')
         .toLowerCase();
     } else {
       escapedId = m.replace(/[^\w]/g, '').toLowerCase();

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
dist/showdown.js.map


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
dist/showdown.min.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
dist/showdown.min.js.map


+ 1 - 1
src/options.js

@@ -23,7 +23,7 @@ function getDefaultOpts(simple) {
     },
     ghCompatibleHeaderId: {
       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'
     },
     headerLevelStart: {

+ 1 - 1
src/subParsers/headers.js

@@ -63,7 +63,7 @@ showdown.subParser('headers', function (text, options, globals) {
         .replace(/~T/g, '')
         .replace(/~D/g, '')
         //replace rest of the chars (&~$ are repeated as they might have been escaped)
-        .replace(/[&~$!@#*()=:/,;?+'.\\]/g, '')
+        .replace(/[&~$!@#*()=:/,;?+'.%\\]/g, '')
         .toLowerCase();
     } else {
       escapedId = m.replace(/[^\w]/g, '').toLowerCase();

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott