]> granicus.if.org Git - python/commitdiff
Patch by Chris Herborth (posted to comp.lang.python)to make it behave
authorGuido van Rossum <guido@python.org>
Mon, 24 Aug 1998 20:59:13 +0000 (20:59 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 24 Aug 1998 20:59:13 +0000 (20:59 +0000)
with tags that have - or . in their names.

Lib/sgmllib.py

index d04204971f2e5c042958d2edf11969da2c2880c3..ffb2ccc348121d88e72e42068558a51a1ebef69a 100644 (file)
@@ -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))