diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2014-02-01 19:20:22 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2014-02-01 19:20:22 (GMT) |
commit | 5a88853bdc1074e62441c7558502bd989c39f056 (patch) | |
tree | 9139d1488b7e1110573b55c50274a185ba4d6100 /Lib/HTMLParser.py | |
parent | 383952d52c2f904d0fcc2c79cc4957b699482ab8 (diff) | |
download | cpython-5a88853bdc1074e62441c7558502bd989c39f056.zip cpython-5a88853bdc1074e62441c7558502bd989c39f056.tar.gz cpython-5a88853bdc1074e62441c7558502bd989c39f056.tar.bz2 |
#20288: fix handling of invalid numeric charrefs in HTMLParser.
Diffstat (limited to 'Lib/HTMLParser.py')
-rw-r--r-- | Lib/HTMLParser.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/HTMLParser.py b/Lib/HTMLParser.py index 5a55e26..3f97830 100644 --- a/Lib/HTMLParser.py +++ b/Lib/HTMLParser.py @@ -195,9 +195,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) |