mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
#20288: fix handling of invalid numeric charrefs in HTMLParser.
This commit is contained in:
parent
a479b7505e
commit
f27b9a741a
3 changed files with 11 additions and 3 deletions
|
@ -228,9 +228,9 @@ class HTMLParser(_markupbase.ParserBase):
|
|||
i = self.updatepos(i, k)
|
||||
continue
|
||||
else:
|
||||
if ";" in rawdata[i:]: #bail by consuming &#
|
||||
self.handle_data(rawdata[0:2])
|
||||
i = self.updatepos(i, 2)
|
||||
if ";" in rawdata[i:]: # bail by consuming &#
|
||||
self.handle_data(rawdata[i:i+2])
|
||||
i = self.updatepos(i, i+2)
|
||||
break
|
||||
elif startswith('&', i):
|
||||
match = entityref.match(rawdata, i)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue