summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'lib/handlebars/compiler')
-rw-r--r--lib/handlebars/compiler/compiler.js2
-rw-r--r--lib/handlebars/compiler/helpers.js5
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js
index a4bd09a..c7fdf3d 100644
--- a/lib/handlebars/compiler/compiler.js
+++ b/lib/handlebars/compiler/compiler.js
@@ -194,7 +194,7 @@ Compiler.prototype = {
},
content: function(content) {
- if (!content.omit) {
+ if (content.string) {
this.opcode('appendContent', content.string);
}
},
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;
}
}