summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/codeq/core.js12
1 files changed, 2 insertions, 10 deletions
diff --git a/js/codeq/core.js b/js/codeq/core.js
index 0976ecc..33c00a4 100644
--- a/js/codeq/core.js
+++ b/js/codeq/core.js
@@ -144,8 +144,6 @@
regexpBackslash = new RegExp('\\\\', 'g'),
regexpWhiteSpaceStart = new RegExp('^[ \r\n\t]+'),
regexpWhiteSpaceEnd = new RegExp('[ \r\n\t]+$'),
- regexpWhiteSpaceBeforeTag = new RegExp('[ \r\n\t]+(?=<)', 'g'),
- regexpWhiteSpaceAfterTag = new RegExp('>[ \r\n\t]+', 'g'),
regexpWhiteSpaceTrim = new RegExp('^[ \\t\\r\\n]*(.*[^ \\t\\r\\n])[ \\t\\r\\n]*$', 'm'),
regexpAmp = new RegExp('&', 'g'),
regexpLt = new RegExp('<', 'g'),
@@ -159,12 +157,6 @@
return str.replace(regexpBackslash, '\\\\').replace(regexpQuote, '\\"').replace(regexpCR, '\\r').replace(regexpLF, '\\n').replace(regexpTab, '\\t');
};
- // given a HTML source, remove whitespace among tags
- var cleanHtml = function (html) {
- // JavaScript doesn't support lookbehind, so we use the split-join trick
- return html.replace(regexpWhiteSpaceBeforeTag, '').split(regexpWhiteSpaceAfterTag).join('>');
- };
-
var resources = {}; // resource tree, loaded from data/resources.json in the boot sequence
// event dispatch
@@ -471,7 +463,7 @@
// start processing
parts = atoms.join('').split('[%');
- if (parts[0].length > 0) src.push('_result.push("', stringToDef(cleanHtml(parts[0])), '");\n'); // the first part that doesn't begin with '[%'
+ if (parts[0].length > 0) src.push('_result.push("', stringToDef(parts[0]), '");\n'); // the first part that doesn't begin with '[%'
for (i = 1; i < parts.length; i++) { // for every part that begins with '[%'
if (parts[i].slice(0, 2) === '--') { // a comment start
subparts = parts[i].split('--%]'); // split at comment end
@@ -507,7 +499,7 @@
}
}
if ((subparts.length > 1) && (subparts[1].length > 0)) { // there's a trailing text
- src.push('_result.push("', stringToDef(cleanHtml(subparts[1])), '");\n');
+ src.push('_result.push("', stringToDef(subparts[1]), '");\n');
}
}
src.push('return _result.join("");');