Skip to content

Commit

Permalink
see #22
Browse files Browse the repository at this point in the history
Fixed an IE9 related problem
  • Loading branch information
mario committed Apr 16, 2014
1 parent 5470d2f commit 839915a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions purify.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,12 @@

/* Cover IE9's buggy outerHTML behavior */
if(dom.body === null) {
dom = document.implementation.createHTMLDocument('');
dom.body.innerHTML = dirty;
if(dom.body.firstChild.nodeName && !WHOLE_DOCUMENT
&& dom.body.firstChild.nodeName === 'STYLE'){
dom.body.removeChild(dom.body.firstChild);
}
}

/* Work on whole document or just its body */
Expand Down

0 comments on commit 839915a

Please sign in to comment.