Humbedooh commented on issue #5:
URL: 
https://github.com/apache/incubator-ponymail-foal/issues/5#issuecomment-687595402


   First bit we can easily do. It will break three unit tests, but we can fix 
that:
   ~~~diff
   @@ -312,8 +312,7 @@ class Archiver(object):  # N.B. Also used by 
import-mbox.py
                    ]:
                        body = Body(part)
                    elif (
   -                    self.html
   -                    and not first_html
   +                    not first_html
                        and part.get_content_type() == "text/html"
                    ):
                        first_html = Body(part)
   @@ -327,7 +326,9 @@ class Archiver(object):  # N.B. Also used by 
import-mbox.py
                or (self.ignore_body and str(body).find(str(self.ignore_body)) 
!= -1)
            ):
                body = first_html
   -            body.assign(self.html2text(str(body)))
   +            # Convert HTML to text if mod is installed and enabled, 
otherwise keep the source as-is
   +            if self.html:
   +                body.assign(self.html2text(str(body)))
            return body
    
        # N.B. this is also called by import-mbox.py
   ~~~


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to