From c5a114bf8886653a98d90ace816ea9b7f9d01248 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Thu, 13 May 2010 01:08:45 +0800 Subject: [PATCH] Reset the buffer only for new renderings, not e.g. partials --- mustache.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mustache.js b/mustache.js index 95088d2..4d48090 100644 --- a/mustache.js +++ b/mustache.js @@ -19,7 +19,8 @@ var Mustache = function() { render: function(template, context, partials, in_recursion) { // reset buffer // TODO: make this non-lazy - this.buffer = []; + if(!in_recursion) + this.buffer = []; // fail fast if(!this.includes("", template)) { if(in_recursion) {