diff --git a/mustache.js b/mustache.js index 641cebd..33694d0 100644 --- a/mustache.js +++ b/mustache.js @@ -86,11 +86,12 @@ var Mustache = (typeof module !== "undefined" && module.exports) || {}; "<": "<", ">": ">", '"': '"', - "'": ''' + "'": ''', + "/": '/' }; function escapeHTML(string) { - return String(string).replace(/&(?!\w+;)|[<>"']/g, function (s) { + return String(string).replace(/[&<>"'\/]/g, function (s) { return escapeMap[s] || s; }); } diff --git a/spec/_files/dot_notation.js b/spec/_files/dot_notation.js index c1295f5..17eb00e 100644 --- a/spec/_files/dot_notation.js +++ b/spec/_files/dot_notation.js @@ -7,8 +7,8 @@ var dot_notation = { return this.value * 0.2; }, currency: { - symbol: '€', - name: 'Euro' + symbol: '$', + name: 'USD' } }, availability:{ diff --git a/spec/_files/dot_notation.txt b/spec/_files/dot_notation.txt index d0e4707..08afa05 100644 --- a/spec/_files/dot_notation.txt +++ b/spec/_files/dot_notation.txt @@ -1,8 +1,8 @@
Authors:
Price: €200 Euro In Stock
-VAT: €40
+Price: $200 USD In Stock
+VAT: $40
Zero: 0
diff --git a/spec/_files/escaped.js b/spec/_files/escaped.js index 7a8baef..903e559 100644 --- a/spec/_files/escaped.js +++ b/spec/_files/escaped.js @@ -2,5 +2,5 @@ var escaped = { title: function() { return "Bear > Shark"; }, - entities: """ + entities: "" \"'<>/" }; diff --git a/spec/_files/escaped.txt b/spec/_files/escaped.txt index 73ac5ce..be2f2e9 100644 --- a/spec/_files/escaped.txt +++ b/spec/_files/escaped.txt @@ -1,2 +1,2 @@