Browse Source

Remove New Roundcube html prefix quote

Guénaël Muller 7 years ago
parent
commit
0db1a6a73f
1 changed files with 5 additions and 0 deletions
  1. 5 0
      tracim/tracim/lib/email_fetcher.py

+ 5 - 0
tracim/tracim/lib/email_fetcher.py View File

@@ -24,6 +24,7 @@ BS_HTML_BODY_PARSE_CONFIG = {
24 24
     'tag_blacklist': ["script", "style", "blockquote"],
25 25
     'class_blacklist': ['moz-cite-prefix','gmail_extra','gmail_quote',
26 26
                         'yahoo_quoted'],
27
+    'id_blacklist': ['reply-intro'],
27 28
     'tag_whitelist': ['a', 'b', 'strong', 'i', 'br', 'ul', 'li', 'ol',
28 29
                       'em', 'i', 'u',
29 30
                       'thead', 'tr', 'td', 'tbody', 'table', 'p', 'pre'],
@@ -94,6 +95,10 @@ class DecodedMail(object):
94 95
                 for elem in config['class_blacklist']:
95 96
                     if elem in tag.attrs['class']:
96 97
                         tag.extract()
98
+            elif 'id' in tag.attrs:
99
+                for elem in config['id_blacklist']:
100
+                    if elem in tag.attrs['id']:
101
+                        tag.extract()
97 102
             elif tag.name.lower() in config['tag_whitelist']:
98 103
                 attrs = dict(tag.attrs)
99 104
                 for attr in attrs: