*** HTMLParser_orig.py Mon Jun 16 22:12:41 2003 --- HTMLParser.py Mon Jun 16 22:15:58 2003 *************** *** 112,117 **** --- 112,125 ---- 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 *************** *** 312,317 **** --- 320,326 ---- 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 *************** *** 325,330 **** --- 334,340 ---- match = endtagfind.match(rawdata, i) # if not match: self.error("bad end tag: %s" % `rawdata[i:j]`) + return j tag = match.group(1) self.handle_endtag(tag.lower()) self.clear_cdata_mode()