From 17eef5a3c26bfa87879e270b1fa4743646bae559 Mon Sep 17 00:00:00 2001 From: Mihai Bazon Date: Mon, 12 Oct 2015 10:21:22 +0300 Subject: [PATCH] Only encode in strings when inline_script --- lib/output.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/output.js b/lib/output.js index 8ca0dc06..1bde822e 100644 --- a/lib/output.js +++ b/lib/output.js @@ -125,10 +125,11 @@ function OutputStream(options) { function encode_string(str, quote) { var ret = make_string(str, quote); - if (options.inline_script) + if (options.inline_script) { ret = ret.replace(/<\x2fscript([>\/\t\n\f\r ])/gi, "<\\/script$1"); - ret = ret.replace(/\x3c!--/g, "\\x3c!--"); - ret = ret.replace(/--\x3e/g, "--\\x3e"); + ret = ret.replace(/\x3c!--/g, "\\x3c!--"); + ret = ret.replace(/--\x3e/g, "--\\x3e"); + } return ret; }; -- 2.34.1