diff --git a/core/shared/lib/showdown/extensions/ghostgfm.js b/core/shared/lib/showdown/extensions/ghostgfm.js index bcc9626d96..6847d8d1c9 100644 --- a/core/shared/lib/showdown/extensions/ghostgfm.js +++ b/core/shared/lib/showdown/extensions/ghostgfm.js @@ -114,7 +114,7 @@ } // Extract pre blocks - text = text.replace(/<(pre|code)>[\s\S]*?<\/(\1)>/gim, function (x) { + text = text.replace(/<(pre|code|script)>[\s\S]*?<\/(\1)>/gim, function (x) { var hash = hashId(); preExtractions[hash] = x; return '{gfm-js-extract-pre-' + hash + '}'; diff --git a/core/test/unit/showdown_ghostGFM_spec.js b/core/test/unit/showdown_ghostGFM_spec.js index 76c919acd7..43093beb80 100644 --- a/core/test/unit/showdown_ghostGFM_spec.js +++ b/core/test/unit/showdown_ghostGFM_spec.js @@ -152,6 +152,10 @@ describe('Ghost GFM showdown extension', function () { input: '', output: /^', + output: /^