summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-07-14 05:50:33 (GMT)
committerFred Drake <fdrake@acm.org>2001-07-14 05:50:33 (GMT)
commit8600b47b61ab9d3fd5cae0bf2f1559c98e42f5da (patch)
tree07ee8b9f96d03b99fb8ca5f6c449eaa6856925ab
parent3eb78609c0f8f22857f08b43e29bea0a197ad201 (diff)
downloadcpython-8600b47b61ab9d3fd5cae0bf2f1559c98e42f5da.zip
cpython-8600b47b61ab9d3fd5cae0bf2f1559c98e42f5da.tar.gz
cpython-8600b47b61ab9d3fd5cae0bf2f1559c98e42f5da.tar.bz2
Be more permissive in what is accepted as an attribute name; this makes
this module slightly more resiliant in the face of XHTML input, or just colons in attribute names.
-rw-r--r--Lib/sgmllib.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/sgmllib.py b/Lib/sgmllib.py
index fe91c1b..5ff9f70 100644
--- a/Lib/sgmllib.py
+++ b/Lib/sgmllib.py
@@ -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'[^>\'\"]+')