fix: allow escaping of colons

Previously, you couldn't escape colons (as they were semi-magic markdown characters).
Colons (:) can now be backslash escaped.
This commit is contained in:
Estevao Soares dos Santos 2018-09-14 21:34:48 +01:00 committed by SyntaxRules
parent e3ddcafd1e
commit 25c44207be
3 changed files with 6 additions and 1 deletions

View File

@ -14,7 +14,7 @@ showdown.subParser('encodeBackslashEscapes', function (text, options, globals) {
text = globals.converter._dispatch('encodeBackslashEscapes.before', text, options, globals); text = globals.converter._dispatch('encodeBackslashEscapes.before', text, options, globals);
text = text.replace(/\\(\\)/g, showdown.helper.escapeCharactersCallback); text = text.replace(/\\(\\)/g, showdown.helper.escapeCharactersCallback);
text = text.replace(/\\([`*_{}\[\]()>#+.!~=|-])/g, showdown.helper.escapeCharactersCallback); text = text.replace(/\\([`*_{}\[\]()>#+.!~=|:-])/g, showdown.helper.escapeCharactersCallback);
text = globals.converter._dispatch('encodeBackslashEscapes.after', text, options, globals); text = globals.converter._dispatch('encodeBackslashEscapes.after', text, options, globals);
return text; return text;

View File

@ -0,0 +1,2 @@
<p>[^1]:a</p>
<p>[^1]:a</p>

View File

@ -0,0 +1,3 @@
\[^1]:a
[^1]\:a