From 6648a17ae226241e3b7b0ab4602e55cb56cc7146 Mon Sep 17 00:00:00 2001 From: David Balderston Date: Mon, 16 Feb 2015 14:28:43 -0800 Subject: [PATCH] Added Script to Not Auto Link and Added Test Closes #4922 * Added script to not be parsed to auto linking * Added test to make sure urls inside --- core/shared/lib/showdown/extensions/ghostgfm.js | 2 +- core/test/unit/showdown_ghostGFM_spec.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) 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: /^