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.
This commit is contained in:
Fred Drake 1999-01-25 21:57:07 +00:00
parent 3dbba6ec3a
commit dfd8954e36
1 changed files with 1 additions and 1 deletions

View File

@ -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./:+*%?!\(\)_#=~]*))?')