diff options
| author | Goffin Simon <sig@odoo.com> | 2015-11-24 10:56:48 +0100 |
|---|---|---|
| committer | Goffin Simon <sig@odoo.com> | 2015-11-25 10:09:25 +0100 |
| commit | 0b52e8a887f41f162fe6593fac264f44042cfbbd (patch) | |
| tree | 47821e9fc57fa5a36af288640ecbcbd67771ac75 | |
| parent | 3b833b20397ef53e8bd2167dee87d764939a74fd (diff) | |
[FIX] tools: html_keep_url
If an url is the label of a tag a, the htm_keep_url doesn't have
to treat this url.
opw:656821
| -rw-r--r-- | openerp/tools/mail.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/openerp/tools/mail.py b/openerp/tools/mail.py index 32f3af766f9..9b02076627e 100644 --- a/openerp/tools/mail.py +++ b/openerp/tools/mail.py @@ -466,7 +466,7 @@ def html_keep_url(text): """ Transform the url into clickable link with <a/> tag """ idx = 0 final = '' - link_tags = re.compile(r"""(?<!["'])((ftp|http|https):\/\/(\w+:{0,1}\w*@)?([^\s"':]+)(:[0-9]+)?(\/|\/([^\s"']))?)(?![^\s"']*["'])""") + link_tags = re.compile(r"""(?<!["'])((ftp|http|https):\/\/(\w+:{0,1}\w*@)?([^\s<"':]+)(:[0-9]+)?(\/|\/([^\s<"']))?)(?![^\s<"']*["']|[^\s<"']*</a>)""") for item in re.finditer(link_tags, text): final += text[idx:item.start()] final += '<a href="%s" target="_blank">%s</a>' % (item.group(0), item.group(0)) |
