Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Bug report
Bug description:
An example where parsing stops after the<style color="red">:
fromhtml.parserimportHTMLParserfromioimportStringIOclassHTML2text(HTMLParser):def__init__(self):super().__init__()self.data=StringIO()defhandle_data(self,html):self.data.write(html)defget_data(self):returnself.data.getvalue().strip()html_test='''<!DOCTYPE html><head><title>Glued</title></head><body><some><style color="red">title</bar><h1>Spacious </h1><a href="https://heading.net">heading.net</a><span>not<a href="https://www.arpa.home">my.home.arpa</a><p> URL</p></body></html>'''parser=HTML2text()parser.feed(html_test)print(parser.get_data())
Changing a single character in the word "style" restores the normal functionality.
CPython versions tested on:
3.11
Operating systems tested on:
Linux
Linked PRs
- gh-118350: Add escapable-raw-text mode to html parser #121770
- gh-118350: Fix support of elements "textarea" and "title" in HTMLParser #135310
- [3.14] gh-118350: Fix support of elements "textarea" and "title" in HTMLParser (GH-135310) #136984
- [3.13] gh-118350: Fix support of elements "textarea" and "title" in HTMLParser (GH-135310) #136985
- [3.12] gh-118350: Fix support of elements "textarea" and "title" in HTMLParser (GH-135310) #136986
- [3.11] gh-118350: Fix support of elements "textarea" and "title" in HTMLParser (GH-135310) #137782
- [3.10] gh-118350: Fix support of elements "textarea" and "title" in HTMLParser (GH-135310) #137783
- [3.9] gh-118350: Fix support of elements "textarea" and "title" in HTMLParser (GH-135310) #137784
Metadata
Metadata
Assignees
Labels
Projects
Status
Done