commit | 554a3b82e40573846f893ffdfff230e1d908af57 | [log] [tgz] |
---|---|---|
author | Victor Stinner <victor.stinner@haypocalc.com> | Mon May 24 21:33:24 2010 +0000 |
committer | Victor Stinner <victor.stinner@haypocalc.com> | Mon May 24 21:33:24 2010 +0000 |
tree | 8ab602c52463479d9d7c7263d25ea77f62f4e4c2 | |
parent | f0757a2937b4b341d828f68c1a857658fac01649 [diff] [blame] |
Issue #6662: Fix parsing of malformatted charref (&#bad;)
diff --git a/Lib/HTMLParser.py b/Lib/HTMLParser.py index 2cbc2ec..7cee47a 100644 --- a/Lib/HTMLParser.py +++ b/Lib/HTMLParser.py
@@ -175,6 +175,9 @@ 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) break elif startswith('&', i): match = entityref.match(rawdata, i)