Revert the backtick escape/unescape patch but keep the docs.

This commit is contained in:
John-David Dalton
2014-01-31 02:05:43 -08:00
parent 65258d5b6a
commit 733da570c8
9 changed files with 202 additions and 226 deletions

View File

@@ -33,8 +33,8 @@
var idCounter = 0;
/** Used to match HTML entities and HTML characters */
var reEscapedHtml = /&(?:amp|lt|gt|quot|#x27|#96);/g,
reUnescapedHtml = /[&<>"'`]/g;
var reEscapedHtml = /&(?:amp|lt|gt|quot|#x27);/g,
reUnescapedHtml = /[&<>"']/g;
/** Used to match template delimiters */
var reEscape = /<%-([\s\S]+?)%>/g,
@@ -61,23 +61,18 @@
/**
* Used to convert characters to HTML entities.
*
* Note: Though the `>` character is escaped for symmetry, characters like `>`
* and `/` don't require escaping in HTML and have no special meaning unless
* they're part of a tag or unquoted attribute value.
* Note: Though the ">" character is escaped for symmetry, characters like
* ">", "`", and "/" don't require escaping in HTML and have no special meaning
* unless they're part of a tag or unquoted attribute value.
* See [Mathias' article](http://mathiasbynens.be/notes/ambiguous-ampersands)
* (under "semi-related fun fact") for more details.
*
* Backticks are escaped because IE < 9 allows them to be used as attribute
* value delimiters. See [Ryan Grove's article](http://wonko.com/post/html-escaping)
* for more details.
*/
var htmlEscapes = {
'&': '&amp;',
'<': '&lt;',
'>': '&gt;',
'"': '&quot;',
"'": '&#x27;',
'`': '&#96;'
"'": '&#x27;'
};
/** Used to convert HTML entities to characters */
@@ -86,8 +81,7 @@
'&lt;': '<',
'&gt;': '>',
'&quot;': '"',
'&#x27;': "'",
'&#96;': '`'
'&#x27;': "'"
};
/** Used to determine if values are of the language type Object */
@@ -4424,7 +4418,7 @@
/*--------------------------------------------------------------------------*/
/**
* Converts the characters "&", "<", ">", '"', "'", and "\`" in `string` to
* Converts the characters "&", "<", ">", '"', and "'" in `string` to
* their corresponding HTML entities.
*
* Note: No other characters are escaped. To escape additional characters
@@ -4593,8 +4587,8 @@
/**
* The inverse of `_.escape`; this method converts the HTML entities
* `&amp;`, `&lt;`, `&gt;`, `&quot;`, `&#39;`, and `&#96;` in `string` to
* their corresponding characters.
* `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to their
* corresponding characters.
*
* Note: No other HTML entities are unescaped. To unescape additional HTML
* entities use a third-party library like [_he_](http://mths.be/he).