Michael Jackson hace 14 años
padre
commit
db5f5ece0b
Se han modificado 1 ficheros con 11 adiciones y 6 borrados
  1. +11
    -6
      mustache.js

+ 11
- 6
mustache.js Ver fichero

@@ -35,13 +35,18 @@ var Mustache = function () {
}
}

var escapeMap = {
"&": "&",
"<": "&lt;",
">": "&gt;",
'"': '&quot;',
"'": '&#39;'
};

function escapeHTML(string) {
return String(string)
.replace(/&(?!\w+;)/g, "&amp;")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#39;");
return String(string).replace(/&(?!\w+;)|[<>"']/g, function (s) {
return escapeMap[s] || s;
});
}

var regexCache = {};


Cargando…
Cancelar
Guardar