diff --git a/CHANGELOG b/CHANGELOG index c30a25c..8c74f9d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +* Make String#unescapeHTML strip tags in IE. Closes #10173. [kangax] + * Stop form observers in unit tests. Closes #10938. [kangax] * Performance improvements for Enumerables. Closes #11264. [Ben, Samuel Lebeau] diff --git a/src/string.js b/src/string.js index 4074402..15791b7 100644 --- a/src/string.js +++ b/src/string.js @@ -211,7 +211,7 @@ if (Prototype.Browser.WebKit || Prototype.Browser.IE) Object.extend(String.proto return this.replace(/&/g,'&').replace(//g,'>'); }, unescapeHTML: function() { - return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); + return this.stripTags().replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); } }); diff --git a/test/unit/string.html b/test/unit/string.html index 320c687..babb58c 100644 --- a/test/unit/string.html +++ b/test/unit/string.html @@ -287,6 +287,7 @@ assertEqual(largeTextUnescaped, largeTextEscaped.unescapeHTML()); assertEqual('1\n2', '1\n2'.unescapeHTML()); + assertEqual('Pride & Prejudice', '

Pride & Prejudice

'.unescapeHTML()); benchmark(function(){ largeTextEscaped.unescapeHTML();