Explorar el Código

83: Add support for & operator for unescaping

Conflicts:

	mustache.js
tags/0.4.0
Don Brown Michael Jackson hace 15 años
padre
commit
634b29d275
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. +2
    -1
      mustache.js

+ 2
- 1
mustache.js Ver fichero

@@ -244,7 +244,7 @@ var Mustache = function () {


var new_regex = function () { var new_regex = function () {
return that.getCachedRegex("render_tags", function (otag, ctag) { 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 case ">": // render partial
return that.render_partial(name, context, partials); return that.render_partial(name, context, partials);
case "{": // the triple mustache is unescaped case "{": // the triple mustache is unescaped
case "&": // & operator is an alternative unescape method
return that.find(name, context); return that.find(name, context);
default: // escape the value default: // escape the value
return escapeHTML(that.find(name, context)); return escapeHTML(that.find(name, context));


Cargando…
Cancelar
Guardar