Avoid maintaining the html escape/unescape regexes independently of the entity maps.

Former-commit-id: 847e58befee7641bc39af37bde12fc99da9edb28
This commit is contained in:
John-David Dalton
2013-07-09 09:04:44 -07:00
parent b2f4f96ef9
commit 2508e71324
8 changed files with 153 additions and 153 deletions

View File

@@ -50,10 +50,6 @@
reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
/** Used to match HTML entities and HTML characters */
var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
reUnescapedHtml = /[&<>"']/g;
/**
* Used to match ES6 template delimiters
* http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6
@@ -1411,6 +1407,10 @@
/** Used to convert HTML entities to characters */
var htmlUnescapes = invert(htmlEscapes);
/** Used to match HTML entities and HTML characters */
var reEscapedHtml = RegExp('(' + keys(htmlUnescapes).join('|') + ')', 'g'),
reUnescapedHtml = RegExp('[' + keys(htmlEscapes).join('') + ']', 'g');
/*--------------------------------------------------------------------------*/
/**