소스 검색

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;
});
}


불러오는 중...
취소
저장