diff --git a/openerp/tools/mail.py b/openerp/tools/mail.py index 3714df9c56f..934d9c15b15 100644 --- a/openerp/tools/mail.py +++ b/openerp/tools/mail.py @@ -52,14 +52,14 @@ class _Cleaner(clean.Cleaner): def __call__(self, doc): # perform quote detection before cleaning and class removal - for el in doc.iter(): + for el in doc.iter(tag=etree.Element): self.tag_quote(el) super(_Cleaner, self).__call__(doc) # if we keep style attribute, sanitize them if not self.style: - for el in doc.iter(): + for el in doc.iter(tag=etree.Element): self.parse_style(el) def tag_quote(self, el):