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

Parser fails in IE(8) when trying to deal with invalidly nested HTML #1

Open
timmolendijk opened this issue Jun 16, 2011 · 0 comments

Comments

@timmolendijk
Copy link

HTML like the following is obviously invalid, but unfortunately IE has a tendency of creating stuff like this (especially when pasting from external editors):

<ul>
  <li>hey<font>!!!</li>
  <li>hit me baby one more time</li>
</ul></font>

If you clean_node the ul in IE(8), the parser not only has a problem with dealing with this scenario, it makes it worse. After sanitization, the HTML (with only ul and li as allowed elements) will look like this:

<UL>
<LI>hey!!!
<LI>hit me baby one more time</LI></LI>
<LI>hit me baby one more time</LI></UL>

Note that this problem only arises in IE8 (and perhaps older versions as well, but that doesn't interest me -- IE9 I haven't tested). So, the exact same process in WebKit or Gecko gives the following HTML, as expected:

<ul>
  <li>hey!!!</li>
  <li>hit me baby one more time</li>
</ul>
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

1 participant