From: Fred Drake Date: Mon, 24 Sep 2001 20:10:28 +0000 (+0000) Subject: Re-factor the HTMLParser class to use the new markupbase.ParserBase class. X-Git-Tag: v2.2.1c1~1647 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bfc8fea1e0c46bc0a337237c32b8c1a32985c144;p=python Re-factor the HTMLParser class to use the new markupbase.ParserBase class. Use a new internal method, error(), consistently to raise parse errors; the new base class also uses this. --- diff --git a/Lib/HTMLParser.py b/Lib/HTMLParser.py index f54e3d6196..08c53b3ff2 100644 --- a/Lib/HTMLParser.py +++ b/Lib/HTMLParser.py @@ -8,6 +8,7 @@ # and CDATA (character data -- only end tags are special). +import markupbase import re import string @@ -21,12 +22,8 @@ entityref = re.compile('&([a-zA-Z][-.a-zA-Z0-9]*)[^a-zA-Z0-9]') charref = re.compile('&#(?:[0-9]+|[xX][0-9a-fA-F]+)[^0-9a-fA-F]') starttagopen = re.compile('<[a-zA-Z]') -piopen = re.compile(r'<\?') piclose = re.compile('>') endtagopen = re.compile(']*>') -commentopen = re.compile('