summaryrefslogtreecommitdiffstats
path: root/Lib/sgmllib.py
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1999-01-25 21:57:07 (GMT)
committerFred Drake <fdrake@acm.org>1999-01-25 21:57:07 (GMT)
commitdfd8954e36b997c2f6adfa34df77bab92db6381d (patch)
treeac4abc5c7f0f61392a9c5dc679e5e32bae1bf318 /Lib/sgmllib.py
parent3dbba6ec3a065a573216bc79b5e4d655ee0cd899 (diff)
downloadcpython-dfd8954e36b997c2f6adfa34df77bab92db6381d.zip
cpython-dfd8954e36b997c2f6adfa34df77bab92db6381d.tar.gz
cpython-dfd8954e36b997c2f6adfa34df77bab92db6381d.tar.bz2
Allow recognition of attributes even if they don't have space in front
of them. I.e., '<a name="foo"href="bar.html">' will now have two attributes recognized. Based on comments from newgroup.
Diffstat (limited to 'Lib/sgmllib.py')
-rw-r--r--Lib/sgmllib.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/sgmllib.py b/Lib/sgmllib.py
index ffb2ccc..8d50a88 100644
--- a/Lib/sgmllib.py
+++ b/Lib/sgmllib.py
@@ -35,7 +35,7 @@ commentopen = re.compile('<!--')
commentclose = re.compile('--[%s]*>' % string.whitespace)
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]*([a-zA-Z_][-.a-zA-Z_0-9]*)' % string.whitespace
+ ('([%s]*=[%s]*' % (string.whitespace, string.whitespace))
+ r'(\'[^\']*\'|"[^"]*"|[-a-zA-Z0-9./:+*%?!\(\)_#=~]*))?')