mirror of
https://github.com/python/cpython.git
synced 2025-12-09 18:48:05 +00:00
Patch by Chris Herborth (posted to comp.lang.python)to make it behave
with tags that have - or . in their names.
This commit is contained in:
parent
607f802886
commit
5fdf85254c
1 changed files with 3 additions and 3 deletions
|
|
@ -24,8 +24,8 @@ entityref = re.compile('&([a-zA-Z][-.a-zA-Z0-9]*)[^a-zA-Z0-9]')
|
||||||
charref = re.compile('&#([0-9]+)[^0-9]')
|
charref = re.compile('&#([0-9]+)[^0-9]')
|
||||||
|
|
||||||
starttagopen = re.compile('<[>a-zA-Z]')
|
starttagopen = re.compile('<[>a-zA-Z]')
|
||||||
shorttagopen = re.compile('<[a-zA-Z][a-zA-Z0-9]*/')
|
shorttagopen = re.compile('<[a-zA-Z][-.a-zA-Z0-9]*/')
|
||||||
shorttag = re.compile('<([a-zA-Z][a-zA-Z0-9]*)/([^/]*)/')
|
shorttag = re.compile('<([a-zA-Z][-.a-zA-Z0-9]*)/([^/]*)/')
|
||||||
piopen = re.compile('<\?')
|
piopen = re.compile('<\?')
|
||||||
piclose = re.compile('>')
|
piclose = re.compile('>')
|
||||||
endtagopen = re.compile('</[<>a-zA-Z]')
|
endtagopen = re.compile('</[<>a-zA-Z]')
|
||||||
|
|
@ -33,7 +33,7 @@ endbracket = re.compile('[<>]')
|
||||||
special = re.compile('<![^<>]*>')
|
special = re.compile('<![^<>]*>')
|
||||||
commentopen = re.compile('<!--')
|
commentopen = re.compile('<!--')
|
||||||
commentclose = re.compile('--[%s]*>' % string.whitespace)
|
commentclose = re.compile('--[%s]*>' % string.whitespace)
|
||||||
tagfind = re.compile('[a-zA-Z][a-zA-Z0-9]*')
|
tagfind = re.compile('[a-zA-Z][-.a-zA-Z0-9]*')
|
||||||
attrfind = re.compile(
|
attrfind = re.compile(
|
||||||
'[%s]+([a-zA-Z_][-.a-zA-Z_0-9]*)' % string.whitespace
|
'[%s]+([a-zA-Z_][-.a-zA-Z_0-9]*)' % string.whitespace
|
||||||
+ ('([%s]*=[%s]*' % (string.whitespace, string.whitespace))
|
+ ('([%s]*=[%s]*' % (string.whitespace, string.whitespace))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue