You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/ezio-melotti'closed_at=<Date2011-10-28.10:27:48.407>created_at=<Date2011-10-27.07:56:01.477>labels= ['type-bug', 'library']
title='HTMLParser improperly handling open tags when strict is False'updated_at=<Date2011-10-28.10:27:48.405>user='https://bugs.python.org/ChristopherAllen-Poole'
This is is encountered when extending html.parser.HTMLParser and running with strict mode False.
Expected behavior:
When '''<div style="" ><b>The <a href="some_url">rain</a> <br /> in <span>Spain</span></b></div>''' is passed to the feed method, div, b, a, br, and span should all be passed to the handle_starttag method.
Actual behavior
The handle_data method receives the values <div style="" >,<b>,<a href="some_url">,<br />,<span> in addition to the regular text.
This can be fixed by changing this (inside the parse_starttag method):
Incidentally I was just investigating this very same issue, and your suggestion seems to work for me too.
I'll see if the change has any downside and come up with a patch + test.
Thanks for the report!
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: