diff options
author | Guido van Rossum <guido@python.org> | 1998-08-24 20:59:13 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1998-08-24 20:59:13 (GMT) |
commit | 5fdf85254c1438760efb452de0fdb1774f29d783 (patch) | |
tree | 7a49db108cf64e5ee1a99978a993c2368e5219d2 /Lib/sgmllib.py | |
parent | 607f802886b85d0871e47d0028715068e0f509ba (diff) | |
download | cpython-5fdf85254c1438760efb452de0fdb1774f29d783.zip cpython-5fdf85254c1438760efb452de0fdb1774f29d783.tar.gz cpython-5fdf85254c1438760efb452de0fdb1774f29d783.tar.bz2 |
Patch by Chris Herborth (posted to comp.lang.python)to make it behave
with tags that have - or . in their names.
Diffstat (limited to 'Lib/sgmllib.py')
-rw-r--r-- | Lib/sgmllib.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/sgmllib.py b/Lib/sgmllib.py index d042049..ffb2ccc 100644 --- a/Lib/sgmllib.py +++ b/Lib/sgmllib.py @@ -24,8 +24,8 @@ entityref = re.compile('&([a-zA-Z][-.a-zA-Z0-9]*)[^a-zA-Z0-9]') charref = re.compile('&#([0-9]+)[^0-9]') starttagopen = re.compile('<[>a-zA-Z]') -shorttagopen = re.compile('<[a-zA-Z][a-zA-Z0-9]*/') -shorttag = re.compile('<([a-zA-Z][a-zA-Z0-9]*)/([^/]*)/') +shorttagopen = re.compile('<[a-zA-Z][-.a-zA-Z0-9]*/') +shorttag = re.compile('<([a-zA-Z][-.a-zA-Z0-9]*)/([^/]*)/') piopen = re.compile('<\?') piclose = re.compile('>') endtagopen = re.compile('</[<>a-zA-Z]') @@ -33,7 +33,7 @@ endbracket = re.compile('[<>]') special = re.compile('<![^<>]*>') commentopen = re.compile('<!--') commentclose = re.compile('--[%s]*>' % string.whitespace) -tagfind = re.compile('[a-zA-Z][a-zA-Z0-9]*') +tagfind = re.compile('[a-zA-Z][-.a-zA-Z0-9]*') attrfind = re.compile( '[%s]+([a-zA-Z_][-.a-zA-Z_0-9]*)' % string.whitespace + ('([%s]*=[%s]*' % (string.whitespace, string.whitespace)) |