]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Be more permissive in what is accepted as an attribute name; this makes
authorFred Drake <fdrake@acm.org>
Sat, 14 Jul 2001 05:50:33 +0000 (05:50 +0000)
committerFred Drake <fdrake@acm.org>
Sat, 14 Jul 2001 05:50:33 +0000 (05:50 +0000)
this module slightly more resiliant in the face of XHTML input, or just
colons in attribute names.

Lib/sgmllib.py

index fe91c1b0398c440871ce10e4bff74793037308dc..5ff9f70c96ad4b1df9824ef0304e239f290e1f6d 100644 (file)
@@ -36,7 +36,7 @@ commentopen = re.compile('<!--')
 commentclose = re.compile(r'--\s*>')
 tagfind = re.compile('[a-zA-Z][-_.a-zA-Z0-9]*')
 attrfind = re.compile(
-    r'\s*([a-zA-Z_][-.a-zA-Z_0-9]*)(\s*=\s*'
+    r'\s*([a-zA-Z_][-:.a-zA-Z_0-9]*)(\s*=\s*'
     r'(\'[^\']*\'|"[^"]*"|[-a-zA-Z0-9./:;+*%?!&$\(\)_#=~\'"]*))?')
 
 decldata = re.compile(r'[^>\'\"]+')