From 9cd0f2b407dd1ccc549e316c76649340acece362 Mon Sep 17 00:00:00 2001 From: ks8 Date: Tue, 8 Apr 2014 10:54:13 +0200 Subject: [PATCH 1/2] Changed Mustache registration, to be compatible with versions >=0.8. See https://github.com/janl/mustache.js/issues/346#issuecomment-29764332 for more information. --- jquery.markup.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/jquery.markup.js b/jquery.markup.js index 1ac62d4..e7c78c2 100644 --- a/jquery.markup.js +++ b/jquery.markup.js @@ -363,8 +363,14 @@ function (txt) { /* global jade: true */ return jade.compile(txt); }); /* Mustache (efficient: pre-compilation, complete: data support) */ - reg("mustache", "Mustache", "http://mustache.github.io/", "Mustache.compile", - function (txt) { /* global Mustache: true */ return Mustache.compile(txt); }); + reg("mustache", "Mustache", "http://mustache.github.io/", function () { return isfn("Mustache.parse") && isfn("Mustache.render"); }, + function(txt) { /* See https://github.com/janl/mustache.js/issues/346#issuecomment-29764332 for more information. */ + Mustache.parse(txt); + return function (view, partials) { + return Mustache.render(txt, view, partials); + }; + } + ); /* Walrus (efficient: pre-compilation, complete: data support) */ reg("walrus", "Walrus", "http://documentup.com/jeremyruppel/walrus/", "Walrus.Parser.parse", From a5d9a8a6a11ff8995345f4a2d9e5c0d0705de214 Mon Sep 17 00:00:00 2001 From: ks8 Date: Mon, 14 Apr 2014 12:49:57 +0200 Subject: [PATCH 2/2] Adjusted Hogan.js registration, to get it working again. --- jquery.markup.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jquery.markup.js b/jquery.markup.js index e7c78c2..838a6d8 100644 --- a/jquery.markup.js +++ b/jquery.markup.js @@ -390,8 +390,8 @@ function (txt) { /* global fmt: true */ return fmt(txt); }); /* Hogan (efficient: pre-compilation, complete: data support) */ - reg("hogan", "Twitter Hogan", "http://twitter.github.io/hogan.js/", "hogan.compile", - function (txt) { /* global hogan: true */ var tmpl = hogan.compile(txt); + reg("hogan", "Twitter Hogan", "http://twitter.github.io/hogan.js/", "Hogan.compile", + function (txt) { /* global hogan: true */ var tmpl = Hogan.compile(txt); return function (data) { return tmpl.render(data); }; }); /* Underscore Template (efficient: pre-compilation, complete: data support) */