|
|
|
@@ -18,10 +18,12 @@ var Mustache = function() { |
|
|
|
context: {}, |
|
|
|
|
|
|
|
render: function(template, context, partials, in_recursion) { |
|
|
|
// reset buffer |
|
|
|
// TODO: make this non-lazy |
|
|
|
if(!in_recursion) |
|
|
|
this.buffer = []; |
|
|
|
// reset buffer & set context |
|
|
|
if(!in_recursion) { |
|
|
|
this.context = context; |
|
|
|
this.buffer = []; // TODO: make this non-lazy |
|
|
|
} |
|
|
|
|
|
|
|
// fail fast |
|
|
|
if(!this.includes("", template)) { |
|
|
|
if(in_recursion) { |
|
|
|
@@ -32,11 +34,6 @@ var Mustache = function() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if(!in_recursion) { |
|
|
|
this.context = context; |
|
|
|
this.buffer = []; |
|
|
|
} |
|
|
|
|
|
|
|
template = this.render_pragmas(template); |
|
|
|
var html = this.render_section(template, context, partials); |
|
|
|
if(in_recursion) { |
|
|
|
|