Skip to content

Instantly share code, notes, and snippets.

@sifu
Created March 9, 2010 13:41
Show Gist options
  • Save sifu/326575 to your computer and use it in GitHub Desktop.
Save sifu/326575 to your computer and use it in GitHub Desktop.
diff --git a/mustache.js b/mustache.js
index 58e6460..1fba949 100644
--- a/mustache.js
+++ b/mustache.js
@@ -118,6 +118,8 @@ var Mustache = function() {
return that.render(content, that.merge(context,
that.create_context(row)), partials, true);
}).join("");
+ } else if(that.is_object(value)) { // Object, Use it as subcontext!
+ return that.render(content, that.merge(context, that.create_context(value)), partials, true);
} else if(value) { // boolean section
return that.render(content, context, partials, true);
} else {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment