Always convert text from html in MessagePreviewExtractor#10919
Conversation
This solves html characters or code in notifications and message previews (thunderbird#10256)
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Updated regex to remove URLs in parentheses from preview text.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
before, it interfered with the preview formatting of headers of forwarded and reply emails.
This comment was marked as resolved.
This comment was marked as resolved.
|
I modified the logic by moving the parsing and cleaning parts in In this way if a message contains only an html part, it is parsed twice. To avoid this a deeper modification is required, I'll wait for opinions from reviewers. Here's an example returning a boolean from |
|
@frabera Thanks for the fix. I think having the flag improves the handling. I would add some tests to check the behavior especially for forwarded emails, special characters and html in plain text. This might help to check the logic works, maybe you could also add more variations, html mail with forwarded plain text or plain text with html forwarded email. Then test with special characters and html code in the plain text part. I'm open for suggestions how to mark the content of the forwarded message. Or even threat this as a separate issue. When working on the test, keep the line breaks as is, otherwise the tests will fail. Ideally the test emails need to be loaded from a file, instead of being part of the code that reformats the message in an incompatible way. We won't have time to fix this now, so we're open for contributions. |
This solves html characters or code in notifications (#10256) and message previews (#8471)
Previously it only converted from html after checking the mimetype
convertFromHtmlIfNecessary()but if the message contained html code or special characters in the plain text part they were rendered in the message previews and in notifications, polluting content.I kept the function, let me know if there is a cleaner way to accomplish this. I tested it with messages containing special characters and also with html code, they are not shown.