ソースを参照

Bug fix: do not escape & in ' entity for apostrophe

The fix consists in adding #? in the negative look-ahead expected to reject
entity references:
  &          // character '&'
  (?!        // not followed by
    #?       //   an optional # (numerical entity), followed by
    \w+      //   a word, followed by
    ;        //   character ';'
  )

instead of
  &          // character '&'
  (?!        // not followed by
    \w+      //   a word, followed by
    ;        //   character ';'
  )
tags/0.4.1
Eric Bréchemier 14年前
コミット
172c34a24f
1個のファイルの変更1行の追加1行の削除
  1. +1
    -1
      mustache.js

+ 1
- 1
mustache.js ファイルの表示

@@ -44,7 +44,7 @@ var Mustache = function () {
};

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


読み込み中…
キャンセル
保存