fix(strikethrough): fix striketrough being wrongly parsed inside codeSpans

This commit is contained in:
Estevao Soares dos Santos 2017-01-29 19:38:45 +00:00
parent 4243a313fd
commit 169cbe8e2d
7 changed files with 10 additions and 1 deletions

BIN
dist/showdown.js vendored

Binary file not shown.

BIN
dist/showdown.js.map vendored

Binary file not shown.

BIN
dist/showdown.min.js vendored

Binary file not shown.

Binary file not shown.

View File

@ -16,7 +16,7 @@ showdown.subParser('encodeCode', function (text, options, globals) {
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
// Now, escape characters that are magic in Markdown:
.replace(/([*_{}\[\]\\=-])/g, showdown.helper.escapeCharactersCallback);
.replace(/([*_{}\[\]\\=~-])/g, showdown.helper.escapeCharactersCallback);
text = globals.converter._dispatch('encodeCode.after', text, options, globals);
return text;

View File

@ -1,3 +1,6 @@
<p>a <del>strikethrough</del> word</p>
<p>this should~~not be parsed</p>
<p><del>strike-through text</del></p>
<p><code>~~strikethough inside code span~~</code></p>
<p>escaped ~~strikethrough~~</p>
<p>escaped ~~strikethrough~~</p>

View File

@ -3,3 +3,9 @@ a ~~strikethrough~~ word
this should~~not be parsed
~~strike-through text~~
`~~strikethough inside code span~~`
escaped \~~strikethrough~~
escaped \~~strikethrough\~~