Menu

#496 Small improvements for HTML-to-plaintext conversion

None
closed-accepted
None
5
2022-05-23
2020-07-23
No

Attached patch improves the way how formatBody function cleans up HTML. If user prefers not to show HTML by default, but email message doesn't have a plaintext version, SquirrelMail simply strips out all HTML tags from message and presents the result. This patch adds few changes to this:

  • <style> tags removed together with their contents
  • newlines in HTML source are replaced with spaces
  • sequences of spaces are squashed together
  • sequenses of empty lines are squashed together to max one empty line

Attached images show an HTML message before and after applying this patch.

3 Attachments

Discussion

  • Paul Lesniewski

    Paul Lesniewski - 2022-05-23
    • status: open --> closed-accepted
    • assigned_to: Paul Lesniewski
    • Group: -->
     
  • Paul Lesniewski

    Paul Lesniewski - 2022-05-23

    This is great work - thank you. Sorry that notification didn't go out to the team for this or it would have been added earlier. Nice work.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.