summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/helpers.js
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2014-08-23 16:37:30 -0500
committerkpdecker <kpdecker@gmail.com>2014-08-23 16:37:30 -0500
commitccd803ff15e98186a82988a67d9aeff411612af4 (patch)
tree4197c4faab142795746df8bef7b5609433cd4aae /lib/handlebars/compiler/helpers.js
parent0528b9164488edc6031510997eb9dab4b64e4ea2 (diff)
downloadhandlebars.js-ccd803ff15e98186a82988a67d9aeff411612af4.zip
handlebars.js-ccd803ff15e98186a82988a67d9aeff411612af4.tar.gz
handlebars.js-ccd803ff15e98186a82988a67d9aeff411612af4.tar.bz2
Replace string value rather than add omit flag
Diffstat (limited to 'lib/handlebars/compiler/helpers.js')
-rw-r--r--lib/handlebars/compiler/helpers.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/handlebars/compiler/helpers.js b/lib/handlebars/compiler/helpers.js
index 5d8fec1..8ba7b40 100644
--- a/lib/handlebars/compiler/helpers.js
+++ b/lib/handlebars/compiler/helpers.js
@@ -140,7 +140,7 @@ function checkWhitespace(isRoot, next1, next2, disallowIndent) {
function omitRight(statements, i) {
var first = statements[i == null ? 0 : i + 1];
if (first) {
- first.omit = true;
+ first.string = '';
}
}
@@ -158,6 +158,7 @@ function omitLeft(statements, i) {
// We omit the last node if it's whitespace only and not preceeded by a non-content node.
if (last && /^[\s]*$/.test(last.string) && (!prev || prev.type === 'content')) {
- return last.omit = true;
+ last.string = '';
+ return true;
}
}