From 937c4f8a5dbfcf190e8a90f6e0e7c2379a08cf35 Mon Sep 17 00:00:00 2001 From: thegrandpoobah Date: Wed, 16 Jun 2010 16:15:10 -0400 Subject: [PATCH] partial fix for issue 48. --- mustache.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mustache.js b/mustache.js index d21058f..f862a00 100644 --- a/mustache.js +++ b/mustache.js @@ -49,9 +49,7 @@ var Mustache = function() { Sends parsed lines */ send: function(line) { - if(line != "") { - this.buffer.push(line); - } + this.buffer.push(line); }, /* @@ -175,9 +173,11 @@ var Mustache = function() { } }; var lines = template.split("\n"); + var oldContent; for(var i = 0; i < lines.length; i++) { + oldContent = lines[i]; lines[i] = lines[i].replace(regex, tag_replace_callback, this); - if(!in_recursion) { + if(!in_recursion && (oldContent === "" || lines[i] !== "")) { this.send(lines[i]); } }