Fix `escapeHTML` in Chrome by using a more strict check.
This commit is contained in:
parent
dee8a1010c
commit
fa15f212fa
|
@ -1,3 +1,5 @@
|
|||
* Make test for `escapeHTML`/`unescapeHTML` more strict. (Chrome 1.x escapes "<" and "&" with `innerHTML`, but not ">") (kangax)
|
||||
|
||||
* Remove another sniffing from one of DOM tests. Fixes last IE8 failure. (kangax)
|
||||
|
||||
* `Element.extend` now takes care of IE8 bug when HTMLAppletElement and HTMLObjectElement objects do not inherit from `Element.prototype`. (kangax)
|
||||
|
|
|
@ -444,13 +444,13 @@ Object.extend(String.prototype.escapeHTML, {
|
|||
|
||||
String.prototype.escapeHTML.div.appendChild(String.prototype.escapeHTML.text);
|
||||
|
||||
if ('<\n'.escapeHTML() !== '<\n') {
|
||||
if ('<\n>'.escapeHTML() !== '<\n>') {
|
||||
String.prototype.escapeHTML = function() {
|
||||
return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');
|
||||
}
|
||||
}
|
||||
|
||||
if ('<\n'.unescapeHTML() !== '<\n') {
|
||||
if ('<\n>'.unescapeHTML() !== '<\n>') {
|
||||
String.prototype.unescapeHTML = function() {
|
||||
return this.stripTags().replace(/</g,'<').replace(/>/g,'>').replace(/&/g,'&');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue