From 54c62e8a5897fa4b03bef56472a20e1b97ce9723 Mon Sep 17 00:00:00 2001 From: "nathan@stravinsky.local" Date: Wed, 23 Jun 2010 10:38:23 -0500 Subject: [PATCH] switched to @janl's way of handling partials to pass more tests --- mustache.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mustache.js b/mustache.js index 4685b1a..a08513a 100644 --- a/mustache.js +++ b/mustache.js @@ -159,16 +159,18 @@ var Mustache = function() { if (!subTemplate) { throw new Error("Unknown partial '" + item.tag + "'"); } - this.render(subTemplate, context, partials); - // TODO: below matches @janl's mustache, but not mustache(5) - /* + + // this is the mustache(5) way + // this.render(subTemplate, context, partials); + + // this is @janl's way var subContext = context[item.tag]; if (typeof(subContext) == "object") { this.render(subTemplate, subContext, partials); } else { this.send(subTemplate); } - */ + } else if (item.operator && !item.noEscape) { // ignore other operators } else if (item.tag) {