From 58c4cffcc854b7f5ea724e9388eb241db4784fec Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Wed, 26 Sep 2012 14:42:05 +0200 Subject: [PATCH] Match end bracket in tagre function. --- dosagelib/util.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dosagelib/util.py b/dosagelib/util.py index 6da682b02..67df1e0d3 100644 --- a/dosagelib/util.py +++ b/dosagelib/util.py @@ -306,8 +306,8 @@ def strtimezone(): def tagre(tag, attribute, value): """Return a regular expression matching the given HTML tag, attribute and value. It matches the tag and attribute names case insensitive, - and skips arbitrary whitespace and leading HTML attributes. - Also, it adds a match group for the value. + and skips arbitrary whitespace and leading HTML attributes. The "<>" at + the start and end of the HTML tag is also matched. @param tag: the tag name @ptype tag: string @param attribute: the attribute name @@ -322,7 +322,7 @@ def tagre(tag, attribute, value): attribute=case_insensitive_re(attribute), 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): """Reformat the given name to a case insensitive regular expression string