Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix for partials / mustache blocks not preceded by content blocks.

  • Loading branch information...
commit 5608e994ca9194e8d535b9a1ce8da99cdb392be6 1 parent f571852
@brianreavis authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 lib/handlebars/compiler/compiler.js
View
8 lib/handlebars/compiler/compiler.js
@@ -225,7 +225,7 @@ Handlebars.JavaScriptCompiler = function() {};
}
this.opcode('invokePartial', id.original);
- this.opcode('indent', partial.indent);
+ this.opcode('indent', partial.indent || '');
this.opcode('append');
},
@@ -237,7 +237,7 @@ Handlebars.JavaScriptCompiler = function() {};
var params = this.setupStackForMustache(mustache);
this.opcode('invokeMustache', params.length, mustache.id.original, !!mustache.hash);
- this.opcode('indent', mustache.indent);
+ this.opcode('indent', mustache.indent || '');
if(mustache.escaped && !this.options.noEscape) {
this.opcode('appendEscaped');
@@ -525,7 +525,9 @@ Handlebars.JavaScriptCompiler = function() {};
},
indent: function(indent) {
- this.pushStack("Handlebars.Utils.indent(" + this.popStack() + ",'" + indent + "')");
+ if (typeof indent === 'string' && indent.length) {
+ this.pushStack("Handlebars.Utils.indent(" + this.popStack() + ",'" + indent + "')");
+ }
},
getContext: function(depth) {
Please sign in to comment.
Something went wrong with that request. Please try again.