summaryrefslogtreecommitdiffstats
path: root/Lib/sgmllib.py
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1998-04-16 21:04:26 (GMT)
committerFred Drake <fdrake@acm.org>1998-04-16 21:04:26 (GMT)
commitde2f708299662fb1646fb6d16f30361e6c5fd558 (patch)
tree400e60d9ac7f71656120d8caa90b868cc2041e94 /Lib/sgmllib.py
parent77d1fce2f651e98e68506cc2ce7321bed7036850 (diff)
downloadcpython-de2f708299662fb1646fb6d16f30361e6c5fd558.zip
cpython-de2f708299662fb1646fb6d16f30361e6c5fd558.tar.gz
cpython-de2f708299662fb1646fb6d16f30361e6c5fd558.tar.bz2
Fix regexp for attrfind; bug reported by Lars Marius Garshol
<larsga@ifi.uio.no>.
Diffstat (limited to 'Lib/sgmllib.py')
-rw-r--r--Lib/sgmllib.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/sgmllib.py b/Lib/sgmllib.py
index 035e891..956341c 100644
--- a/Lib/sgmllib.py
+++ b/Lib/sgmllib.py
@@ -30,12 +30,12 @@ endtagopen = re.compile('</[<>a-zA-Z]')
endbracket = re.compile('[<>]')
special = re.compile('<![^<>]*>')
commentopen = re.compile('<!--')
-commentclose = re.compile('--[ \t\n]*>')
+commentclose = re.compile('--[%s]*>' % string.whitespace)
tagfind = re.compile('[a-zA-Z][a-zA-Z0-9]*')
attrfind = re.compile(
- '[ \t\n]+([a-zA-Z_][-.a-zA-Z_0-9]*)'
- '([ \t\n]*=[ \t\n]*'
- r'(\'[^\']*\'|"[^"]*"|[-a-zA-Z0-9./:+*%?!\(\)_#=~]*))?')
+ '[ \t\n\r]+([a-zA-Z_][-.a-zA-Z_0-9]*)'
+ + ('([%s]*=[%s]*' % (string.whitespace, string.whitespace))
+ + r'(\'[^\']*\'|"[^"]*"|[-a-zA-Z0-9./:+*%?!\(\)_#=~]*))?')
# SGML parser base class -- find tags and call handler functions.