Index: Lib/HTMLParser.py
===================================================================
--- Lib/HTMLParser.py (revision 69418)
+++ Lib/HTMLParser.py (working copy)
@@ -112,6 +112,14 @@
self.goahead(1)
def error(self, message):
+ """Report a parse error.
+
+ This is called by HTMLParser to report a parse error. The default
+ implementation raises HTMLParseError. If you override this method
+ to do something other than raise an exception (such as logging the
+ parse error), the HTMLParser will continue parsing on a "best
+ effort" basis after this method returns.
+ """
raise HTMLParseError(message, self.getpos())
__starttag_text = None
@@ -299,6 +307,7 @@
return -1
self.updatepos(i, j)
self.error("malformed start tag")
+ return j
raise AssertionError("we should not get here!")
# Internal -- parse endtag, return end or -1 if incomplete
@@ -312,6 +321,7 @@
match = endtagfind.match(rawdata, i) # + tag + >
if not match:
self.error("bad end tag: %r" % (rawdata[i:j],))
+ return j
tag = match.group(1)
self.handle_endtag(tag.lower())
self.clear_cdata_mode()