Fix order of replacement in String#unescapeHTML [#544 state:resolved] (SWeini, kangax)
This commit is contained in:
parent
432a9422d6
commit
e3845ba0f6
@ -1,3 +1,5 @@
|
||||
* Fix order of replacement in String#unescapeHTML [#544 state:resolved] (SWeini, kangax)
|
||||
|
||||
* Fix issue where a Selector query rooted on a node that had not been attached to the document failed in IE. [#464 state:resolved] (jddalton, kangax, Douglas Fraser, Andrew Dupont)
|
||||
|
||||
* Fix Selector to match elements with attributes containing hyphens. [#285 state:resolved] (leiyou, jddalton, kangax)
|
||||
|
@ -431,7 +431,7 @@ if (Prototype.Browser.WebKit || Prototype.Browser.IE) Object.extend(String.proto
|
||||
return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');
|
||||
},
|
||||
unescapeHTML: function() {
|
||||
return this.stripTags().replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');
|
||||
return this.stripTags().replace(/</g,'<').replace(/>/g,'>').replace(/&/g,'&');
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -255,6 +255,8 @@ new Test.Unit.Runner({
|
||||
this.assertEqual('1\n2', '1\n2'.unescapeHTML());
|
||||
this.assertEqual('Pride & Prejudice', '<h1>Pride & Prejudice</h1>'.unescapeHTML());
|
||||
|
||||
this.assertIdentical('<', '&lt;'.unescapeHTML());
|
||||
|
||||
this.benchmark(function() { largeTextEscaped.unescapeHTML() }, 1000);
|
||||
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user