mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-86155: Fix data loss after unclosed script or style tag in HTMLParser (GH-22658)
When calling .close() the HTMLParser should flush all remaining content, even when that content is in an unclosed script or style tag.
This commit is contained in:
parent
7dddb4e667
commit
53383e90e4
3 changed files with 13 additions and 1 deletions
|
@ -260,7 +260,7 @@ class HTMLParser(_markupbase.ParserBase):
|
|||
else:
|
||||
assert 0, "interesting.search() lied"
|
||||
# end while
|
||||
if end and i < n and not self.cdata_elem:
|
||||
if end and i < n:
|
||||
if self.convert_charrefs and not self.cdata_elem:
|
||||
self.handle_data(unescape(rawdata[i:n]))
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue