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

@@ -24,10 +24,6 @@
/** Used to prefix keys to avoid issues with `__proto__` and properties on `Object.prototype` */
var keyPrefix = +new Date + '';
/** Used to match HTML entities and HTML characters */
var reEscapedHtml = /&(?:amp|lt|gt|quot|#x27|#x2F);/g,
reUnescapedHtml = /[&<>"'\/]/g;
/** Used to match "interpolate" template delimiters */
var reInterpolate = /<%=([\s\S]+?)%>/g;
@@ -589,6 +585,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');
/*--------------------------------------------------------------------------*/
/**