diff --git a/examples/empty_template.html b/examples/empty_template.html new file mode 100644 index 0000000..bb2367a --- /dev/null +++ b/examples/empty_template.html @@ -0,0 +1 @@ +

Test

\ No newline at end of file diff --git a/examples/empty_template.js b/examples/empty_template.js new file mode 100644 index 0000000..564c9e2 --- /dev/null +++ b/examples/empty_template.js @@ -0,0 +1 @@ +var empty_template = {}; diff --git a/examples/empty_template.txt b/examples/empty_template.txt new file mode 100644 index 0000000..60652b6 --- /dev/null +++ b/examples/empty_template.txt @@ -0,0 +1 @@ +

Test

diff --git a/mustache.js b/mustache.js index f090852..649f373 100644 --- a/mustache.js +++ b/mustache.js @@ -21,7 +21,11 @@ var Mustache = function() { render: function(template, context, partials, in_recursion) { // fail fast if(template.indexOf(this.otag) == -1) { - return template; + if(in_recursion) { + return template; + } else { + this.send(template); + } } if(!in_recursion) {