projects
/
odoo
/
odoo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8e15ab0
)
[IMP] tools: html_email_clean: a bit more robust.
author
Thibault Delavallée
<tde@openerp.com>
Wed, 14 Nov 2012 14:14:52 +0000
(15:14 +0100)
committer
Thibault Delavallée
<tde@openerp.com>
Wed, 14 Nov 2012 14:14:52 +0000
(15:14 +0100)
bzr revid: tde@openerp.com-
20121114141452
-n5jy3yzbmlbd3811
openerp/tools/mail.py
patch
|
blob
|
history
diff --git
a/openerp/tools/mail.py
b/openerp/tools/mail.py
index
5f8c65c
..
39d918d
100644
(file)
--- a/
openerp/tools/mail.py
+++ b/
openerp/tools/mail.py
@@
-133,9
+133,8
@@
def html_email_clean(html):
html = ustr(html)
# 1. <br[ /]> -> \n, because otherwise the tree is obfuscated
- br_tags = re.compile(r'([<]\s*br\s*\/?[>])')
+ br_tags = re.compile(r'([<]\s*[bB][rR]\s*\/?[>])')
html = _replace_matching_regex(br_tags, html, '__BR_TAG__')
- # TDE note: seems to have lots of <div><br></div> in emails... needs to be checks, could be cleaned
# 2. form a tree, handle (currently ?) pure-text by enclosing them in a pre
root = lxml.html.fromstring(html)