-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
HTMLParser improperly handling open tags when strict is False #57482
Comments
This is is encountered when extending html.parser.HTMLParser and running with strict mode False. Expected behavior: Actual behavior This can be fixed by changing this (inside the parse_starttag method): m = hparse.attrfind_tolerant.search(rawdata, k) to m = hparse.attrfind_tolerant.match(rawdata, k) |
Incidentally I was just investigating this very same issue, and your suggestion seems to work for me too. |
The attached patch fixes replaces search with match as you suggested and tweaks a regex to make the old tests pass. |
New changeset 41d41776aa6d by Ezio Melotti in branch '3.2': New changeset b194117f176c by Ezio Melotti in branch 'default': |
Fixed, thanks a lot 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: