diff options
author | Robert Zorko <robertz@gurucue.com> | 2015-10-15 14:41:42 +0200 |
---|---|---|
committer | Robert Zorko <robertz@gurucue.com> | 2015-10-15 14:41:42 +0200 |
commit | 06d68b825159f99ac8356782d6656f52aa9d6c73 (patch) | |
tree | 4905c72bede2f7e0ac96bcff9cdab66c1ac49e2f | |
parent | feb87a34e3b195d7c204f5d017e108f4f46498e0 (diff) | |
parent | a78e4ac73f8a7b5fb664c703562717d165ff7760 (diff) |
Merge branch 'master' of ssh://212.235.189.51:22122/codeq-web
-rw-r--r-- | js/codeq/core.js | 12 |
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("");'); |