preserve case when inline_script (#2991)

fixes #2989
This commit is contained in:
Alex Lam S.L
2018-03-11 05:11:12 +08:00
committed by GitHub
parent 7e00a12741
commit fc6ebd04a5
4 changed files with 24 additions and 4 deletions

View File

@@ -178,7 +178,7 @@ function OutputStream(options) {
function encode_string(str, quote) {
var ret = make_string(str, quote);
if (options.inline_script) {
ret = ret.replace(/<\x2fscript([>\/\t\n\f\r ])/gi, "<\\/script$1");
ret = ret.replace(/<\x2f(script)([>\/\t\n\f\r ])/gi, "<\\/$1$2");
ret = ret.replace(/\x3c!--/g, "\\x3c!--");
ret = ret.replace(/--\x3e/g, "--\\x3e");
}