SF Patch # 103839 byt dougfort: Allow ';' in attributes

sgmllib does not recognize HTML attributes containing the semicolon
';' character. This may be in accordance with the HTML spec, but there
are sites that use it (excite.com) and the browsers I regularly use
(IE5, Netscape, Opera) all handle it. Doug Fort Downright Software LLC
This commit is contained in:
Guido van Rossum 2001-02-19 18:39:09 +00:00
parent 8ba9445dd3
commit b68c245662
1 changed files with 1 additions and 1 deletions

View File

@ -38,7 +38,7 @@ 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))
+ r'(\'[^\']*\'|"[^"]*"|[-a-zA-Z0-9./:+*%?!&$\(\)_#=~]*))?')
+ r'(\'[^\']*\'|"[^"]*"|[-a-zA-Z0-9./:;+*%?!&$\(\)_#=~]*))?')
# SGML parser base class -- find tags and call handler functions.