From 634b29d27528f40bb33748302bc8d7377977270c Mon Sep 17 00:00:00 2001 From: Don Brown Date: Tue, 1 Mar 2011 11:28:41 +1100 Subject: [PATCH] 83: Add support for & operator for unescaping Conflicts: mustache.js --- mustache.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mustache.js b/mustache.js index 1ff6d08..977c3c1 100644 --- a/mustache.js +++ b/mustache.js @@ -244,7 +244,7 @@ var Mustache = function () { var new_regex = function () { return that.getCachedRegex("render_tags", function (otag, ctag) { - return new RegExp(otag + "(=|!|>|\\{|%)?([^#\\^]+?)\\1?" + ctag + "+", "g"); + return new RegExp(otag + "(=|!|>|&|\\{|%)?([^#\\^]+?)\\1?" + ctag + "+", "g"); }); }; @@ -260,6 +260,7 @@ var Mustache = function () { case ">": // render partial return that.render_partial(name, context, partials); case "{": // the triple mustache is unescaped + case "&": // & operator is an alternative unescape method return that.find(name, context); default: // escape the value return escapeHTML(that.find(name, context));