]> granicus.if.org Git - python/commitdiff
(sgmllib.py): Partial acceptance of patch from David Leonard
authorFred Drake <fdrake@acm.org>
Mon, 16 Dec 1996 21:56:27 +0000 (21:56 +0000)
committerFred Drake <fdrake@acm.org>
Mon, 16 Dec 1996 21:56:27 +0000 (21:56 +0000)
<leonard@dstc.edu.au>; allows hyphen and period in the middle
of attribute names.  Still not allowed as first character;
as first character these are illegal in the Reference Concrete
Syntax, and we've not identified any use of these characters as
the first char in an attribute name in deployment on the web.

Lib/sgmllib.py

index 304bbdbff0e956bebef010292f86a392b7765637..8f32001880063d7c40d69fd66256d8a0e4252495 100644 (file)
@@ -33,7 +33,7 @@ commentopen = regex.compile('<!--')
 commentclose = regex.compile('--[ \t\n]*>')
 tagfind = regex.compile('[a-zA-Z][a-zA-Z0-9]*')
 attrfind = regex.compile(
-    '[ \t\n]+\([a-zA-Z_][a-zA-Z_0-9]*\)'
+    '[ \t\n]+\([a-zA-Z_][-.a-zA-Z_0-9]*\)'
     '\([ \t\n]*=[ \t\n]*'
     '\(\'[^\']*\'\|"[^"]*"\|[-a-zA-Z0-9./:+*%?!()_#=~]*\)\)?')