Browse Source

consider img tag as content

Guénaël Muller 7 years ago
parent
commit
12ea2451b0
1 changed files with 2 additions and 1 deletions
  1. 2 1
      tracim/tracim/lib/email_processing/models.py

+ 2 - 1
tracim/tracim/lib/email_processing/models.py View File

109
         if len(self._list) > 0:
109
         if len(self._list) > 0:
110
             txt = BeautifulSoup(value.text, 'html.parser').get_text()
110
             txt = BeautifulSoup(value.text, 'html.parser').get_text()
111
             txt = txt.replace('\n', '').strip()
111
             txt = txt.replace('\n', '').strip()
112
-            if not txt:
112
+            img = BeautifulSoup(value.text, 'html.parser').find('img')
113
+            if not txt and not img:
113
                 value.part_type = self._list[-1].part_type
114
                 value.part_type = self._list[-1].part_type
114
         BodyMailParts._check_value(value)
115
         BodyMailParts._check_value(value)
115
         BodyMailParts._append(self, value)
116
         BodyMailParts._append(self, value)