Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with incorrectly formed documents in IE #20

Closed
shauryamal opened this issue Mar 30, 2014 · 2 comments
Closed

Problems with incorrectly formed documents in IE #20

shauryamal opened this issue Mar 30, 2014 · 2 comments

Comments

@shauryamal
Copy link

This issue has been observed in IE8. It may or may not be present in later versions of IE.

Improperly nested and/or un-closed tags in HTML markup can corrupt the DOM tree in Internet Explorer 8. While trying to parse and fix the markup, IE messes it up by creating duplicate nodes at multiple locations in the document. This leads to incorrect parent references with the parentNode property.

The current implementation of findAndReplaceDOMText uses the parentNode property to traverse up a document tree, and the results in IE can be unpredictable with improperly formed HTML documents.

The Fiddle http://fiddle.jshell.net/2fxRF/show/ demonstrates the issue. The box with a red border contains an un-closed DIV, while the box with a blue border contains well formed HTML. In the red box, the first replacement of the text "the" is correct but the replacement after the un-closed DIV is not correct.

@padolsey
Copy link
Owner

Thanks for the report (and the fix)! Looking into this right now.

@padolsey
Copy link
Owner

Fixed via #21 (thanks!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants