]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Allow underscores in tag names and quote characters in unquoted attribute
authorFred Drake <fdrake@acm.org>
Thu, 5 Jul 2001 18:22:48 +0000 (18:22 +0000)
committerFred Drake <fdrake@acm.org>
Thu, 5 Jul 2001 18:22:48 +0000 (18:22 +0000)
values.  The change for attribute values matches the way Mozilla and
Navigator view the world, at least.

This closes SF bug #436621.

Lib/sgmllib.py

index 5388c07b20d539450622e65fa286daac1bfe0d84..f612f2e900d9141a1fb9f4e51ffd550ba2ada82d 100644 (file)
@@ -34,10 +34,10 @@ endbracket = re.compile('[<>]')
 special = re.compile('<![^<>]*>')
 commentopen = re.compile('<!--')
 commentclose = re.compile(r'--\s*>')
-tagfind = re.compile('[a-zA-Z][-.a-zA-Z0-9]*')
+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'(\'[^\']*\'|"[^"]*"|[-a-zA-Z0-9./:;+*%?!&$\(\)_#=~]*))?')
+    r'(\'[^\']*\'|"[^"]*"|[-a-zA-Z0-9./:;+*%?!&$\(\)_#=~\'"]*))?')
 
 declname = re.compile(r'[a-zA-Z][-_.a-zA-Z0-9]*\s*')
 declstringlit = re.compile(r'(\'[^\']*\'|"[^"]*")\s*')