diff --git a/CHANGELOG b/CHANGELOG index c4a3071..3f84b1c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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) diff --git a/src/lang/string.js b/src/lang/string.js index 5530ebb..47f4ba6 100644 --- a/src/lang/string.js +++ b/src/lang/string.js @@ -431,7 +431,7 @@ if (Prototype.Browser.WebKit || Prototype.Browser.IE) Object.extend(String.proto return this.replace(/&/g,'&').replace(//g,'>'); }, unescapeHTML: function() { - return this.stripTags().replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); + return this.stripTags().replace(/</g,'<').replace(/>/g,'>').replace(/&/g,'&'); } }); diff --git a/test/unit/string_test.js b/test/unit/string_test.js index 3590579..a0b016c 100644 --- a/test/unit/string_test.js +++ b/test/unit/string_test.js @@ -255,6 +255,8 @@ new Test.Unit.Runner({ this.assertEqual('1\n2', '1\n2'.unescapeHTML()); this.assertEqual('Pride & Prejudice', '