Match end bracket in tagre function.
This commit is contained in:
parent
49251669f3
commit
58c4cffcc8
1 changed files with 3 additions and 3 deletions
|
@ -306,8 +306,8 @@ def strtimezone():
|
||||||
def tagre(tag, attribute, value):
|
def tagre(tag, attribute, value):
|
||||||
"""Return a regular expression matching the given HTML tag, attribute
|
"""Return a regular expression matching the given HTML tag, attribute
|
||||||
and value. It matches the tag and attribute names case insensitive,
|
and value. It matches the tag and attribute names case insensitive,
|
||||||
and skips arbitrary whitespace and leading HTML attributes.
|
and skips arbitrary whitespace and leading HTML attributes. The "<>" at
|
||||||
Also, it adds a match group for the value.
|
the start and end of the HTML tag is also matched.
|
||||||
@param tag: the tag name
|
@param tag: the tag name
|
||||||
@ptype tag: string
|
@ptype tag: string
|
||||||
@param attribute: the attribute name
|
@param attribute: the attribute name
|
||||||
|
@ -322,7 +322,7 @@ def tagre(tag, attribute, value):
|
||||||
attribute=case_insensitive_re(attribute),
|
attribute=case_insensitive_re(attribute),
|
||||||
value=value,
|
value=value,
|
||||||
)
|
)
|
||||||
return r'<\s*%(tag)s[^>]*\s+%(attribute)s\s*=\s*"(%(value)s)"' % attrs
|
return r'<\s*%(tag)s[^>]*\s+%(attribute)s\s*=\s*"%(value)s"[^>]>' % attrs
|
||||||
|
|
||||||
def case_insensitive_re(name):
|
def case_insensitive_re(name):
|
||||||
"""Reformat the given name to a case insensitive regular expression string
|
"""Reformat the given name to a case insensitive regular expression string
|
||||||
|
|
Loading…
Reference in a new issue