From 169cbe8e2d9f818b4dcbdf950f0ca8edf60f4f36 Mon Sep 17 00:00:00 2001 From: Estevao Soares dos Santos Date: Sun, 29 Jan 2017 19:38:45 +0000 Subject: [PATCH] fix(strikethrough): fix striketrough being wrongly parsed inside codeSpans --- dist/showdown.js | Bin 80093 -> 80094 bytes dist/showdown.js.map | Bin 233463 -> 233464 bytes dist/showdown.min.js | Bin 33536 -> 33537 bytes dist/showdown.min.js.map | Bin 36288 -> 36288 bytes src/subParsers/encodeCode.js | 2 +- test/features/#164.3.strikethrough.html | 3 +++ test/features/#164.3.strikethrough.md | 6 ++++++ 7 files changed, 10 insertions(+), 1 deletion(-) diff --git a/dist/showdown.js b/dist/showdown.js index a85d027f36bd3024142fc273b01aa4a2236da196..a49a0b9fd41b11280f1e0a2f9ffe3f2c2c642858 100644 GIT binary patch delta 26 icmccnk>%b;mJQ|GnCo<7CqLL^Fgb6t?&fRT*qZ>pG7XFX delta 25 hcmccjk>&13mJQ|Gm~>+&KiFh2Id8M>=Ih(on*gxG4GsVR diff --git a/dist/showdown.js.map b/dist/showdown.js.map index e0fadd02d18c914296e5e357465a19fb384ab441..b30854b5974259cc09df27f3c9662c3db1e2ce16 100644 GIT binary patch delta 57 zcmV-90LK6KpAPt+4uG@)%vO`zJqnZW@CuheQ2`{E$Uy-Nm;5mSpNFqk0k^ML0;jM7 Pel3;-17Nqe2m?Te?!*_r delta 55 zcmV-70LcINpAPq*4uG@)%vP6HE&>ymaCre0lYadV0yRaK@i76ahp$%wx35T6?Fgr diff --git a/dist/showdown.min.js b/dist/showdown.min.js index 9a5095dc11e93d2cdc5eae71393d85bd7b701c91..3b495b05edf0cec9ef6ff5132401307055b15628 100644 GIT binary patch delta 25 gcmZo@V`^+;+92l5R;L@Qsh>VMPflsGt@mMb0Bc+bW&i*H delta 24 fcmZo{V`^w)+92l5svE1RpFTNHPHD59_hEAYV95vQ diff --git a/dist/showdown.min.js.map b/dist/showdown.min.js.map index 67b07754d209b848f806c0a618a347e702309d60..b264bab65ebe09be00c27209c2643665f345d65f 100644 GIT binary patch delta 35 rcmX>wo9V!8rVW2WSPPvT9g8P3h6*!fxl9%ek)9myCcfDtw88=a^ivFW delta 35 rcmX>wo9V!8rVW2WSo5769SbKjh6*!fxJ(udk)9myCcfDtw88=a^Vtk= diff --git a/src/subParsers/encodeCode.js b/src/subParsers/encodeCode.js index 3e5638a..debda4d 100644 --- a/src/subParsers/encodeCode.js +++ b/src/subParsers/encodeCode.js @@ -16,7 +16,7 @@ showdown.subParser('encodeCode', function (text, options, globals) { .replace(//g, '>') // 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; diff --git a/test/features/#164.3.strikethrough.html b/test/features/#164.3.strikethrough.html index f300ece..c0cd541 100644 --- a/test/features/#164.3.strikethrough.html +++ b/test/features/#164.3.strikethrough.html @@ -1,3 +1,6 @@

a strikethrough word

this should~~not be parsed

strike-through text

+

~~strikethough inside code span~~

+

escaped ~~strikethrough~~

+

escaped ~~strikethrough~~

diff --git a/test/features/#164.3.strikethrough.md b/test/features/#164.3.strikethrough.md index 3498b1a..0356b6b 100644 --- a/test/features/#164.3.strikethrough.md +++ b/test/features/#164.3.strikethrough.md @@ -3,3 +3,9 @@ a ~~strikethrough~~ word this should~~not be parsed ~~strike-through text~~ + +`~~strikethough inside code span~~` + +escaped \~~strikethrough~~ + +escaped \~~strikethrough\~~