Browse Source

Merge e47231ea26 into 23beb3a880

pull/531/merge
Silviu Marian GitHub 9 years ago
parent
commit
4ca13df629
1 changed files with 4 additions and 6 deletions
  1. +4
    -6
      mustache.js

+ 4
- 6
mustache.js View File

@@ -58,7 +58,6 @@
}

var entityMap = {
'&': '&',
'<': '&lt;',
'>': '&gt;',
'"': '&quot;',
@@ -67,11 +66,10 @@
'`': '&#x60;',
'=': '&#x3D;'
};

function escapeHtml (string) {
return String(string).replace(/[&<>"'`=\/]/g, function fromEntityMap (s) {
return entityMap[s];
});
function escapeHtml(string) {
return String(string)
.replace(/[<>"'\/]/g, function (s) { return entityMap[s]; })
.replace(/&(?![A-Za-z0-9#][A-Za-z0-9]+;)+/g, '&amp;');
}

var whiteRe = /\s*/;


Loading…
Cancel
Save