Skip to content

Commit 25c4420

Browse files
tivieSyntaxRules
authored andcommitted
fix: allow escaping of colons
Previously, you couldn't escape colons (as they were semi-magic markdown characters). Colons (:) can now be backslash escaped.
1 parent e3ddcaf commit 25c4420

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

src/subParsers/encodeBackslashEscapes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ showdown.subParser('encodeBackslashEscapes', function (text, options, globals) {
1414
text = globals.converter._dispatch('encodeBackslashEscapes.before', text, options, globals);
1515

1616
text = text.replace(/\\(\\)/g, showdown.helper.escapeCharactersCallback);
17-
text = text.replace(/\\([`*_{}\[\]()>#+.!~=|-])/g, showdown.helper.escapeCharactersCallback);
17+
text = text.replace(/\\([`*_{}\[\]()>#+.!~=|:-])/g, showdown.helper.escapeCharactersCallback);
1818

1919
text = globals.converter._dispatch('encodeBackslashEscapes.after', text, options, globals);
2020
return text;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<p>[^1]:a</p>
2+
<p>[^1]:a</p>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
\[^1]:a
2+
3+
[^1]\:a

0 commit comments

Comments
 (0)