diff --git a/openerp/tests/test_mail.py b/openerp/tests/test_mail.py index 3dbae1473b0..7d177aba937 100755 --- a/openerp/tests/test_mail.py +++ b/openerp/tests/test_mail.py @@ -35,7 +35,7 @@ class TestSanitizer(unittest2.TestCase): def test_basic_sanitizer(self): cases = [ ("yop", "
yop
"), # simple - ("lalayop
xxx", "lala
yop
xxxyop
xxx", "lala
yop
xxx"), # trailing text ("Merci à l'intérêt pour notre produit.nous vous contacterons bientôt. Merci", u"Merci à l'intérêt pour notre produit.nous vous contacterons bientôt. Merci
"), # unicode ] diff --git a/openerp/tools/mail.py b/openerp/tools/mail.py index 3148083908a..4b686f0af34 100644 --- a/openerp/tools/mail.py +++ b/openerp/tools/mail.py @@ -106,6 +106,11 @@ def html_sanitize(src, silent=True, strict=False): raise logger.warning('unknown error obtained when sanitizing %r', src, exc_info=True) cleaned = 'Unknown error when sanitizing
' + + # this is ugly, but lxml/etree tostring want to put everything in a 'div' that breaks the editor -> remove that + if cleaned.startswith('