diff --git a/CHANGELOG b/CHANGELOG index 736ad34..08cff6f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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) diff --git a/src/lang/string.js b/src/lang/string.js index 90c2ea6..6d715c1 100644 --- a/src/lang/string.js +++ b/src/lang/string.js @@ -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,'>'); } } -if ('<\n'.unescapeHTML() !== '<\n') { +if ('<\n>'.unescapeHTML() !== '<\n>') { String.prototype.unescapeHTML = function() { return this.stripTags().replace(/</g,'<').replace(/>/g,'>').replace(/&/g,'&'); }