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
parent c7a89eaae4
commit a4be301331
3 changed files with 6 additions and 1 deletions

View File

@ -14,7 +14,7 @@ showdown.subParser('makehtml.encodeBackslashEscapes', function (text, options, g
text = globals.converter._dispatch('makehtml.encodeBackslashEscapes.before', text, options, globals).getText();
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('makehtml.encodeBackslashEscapes.after', text, options, globals).getText();
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