|
@@ -1,7 +1,5 @@
|
1
|
1
|
# -*- coding: utf-8 -*-
|
2
|
2
|
from bs4 import BeautifulSoup
|
3
|
|
-from bs4 import NavigableString
|
4
|
|
-from bs4 import Tag
|
5
|
3
|
|
6
|
4
|
from tracim.lib.email_processing.checkers import ProprietaryHTMLAttrValues
|
7
|
5
|
from tracim.lib.email_processing.checkers import HtmlMailQuoteChecker
|
|
@@ -10,6 +8,7 @@ from tracim.lib.email_processing.models import BodyMailPartType
|
10
|
8
|
from tracim.lib.email_processing.models import BodyMailPart
|
11
|
9
|
from tracim.lib.email_processing.models import HtmlBodyMailParts
|
12
|
10
|
|
|
11
|
+
|
13
|
12
|
class PreSanitizeConfig(object):
|
14
|
13
|
"""
|
15
|
14
|
To avoid problems, html need to be sanitize a bit during parsing to distinct
|
|
@@ -88,7 +87,10 @@ class ParsedHTMLMail(object):
|
88
|
87
|
return parts
|
89
|
88
|
|
90
|
89
|
@classmethod
|
91
|
|
- def _process_elements(cls, elements: HtmlBodyMailParts) -> HtmlBodyMailParts:
|
|
90
|
+ def _process_elements(
|
|
91
|
+ cls,
|
|
92
|
+ elements: HtmlBodyMailParts,
|
|
93
|
+ ) -> HtmlBodyMailParts:
|
92
|
94
|
if len(elements) >= 2:
|
93
|
95
|
# Case 1 and 2, only one main and one quote
|
94
|
96
|
if elements.get_nb_part_type('main') == 1 and \
|