Uploaded image for project: 'Kopano WebApp'
  1. Kopano WebApp
  2. KW-3200

Convert all HTML entities when converting from HTML to Plaintext

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Medium
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 3.5.12
    • Security Level: Public
    • Labels:
      None

      Description

      In KW-3196 it was discovered that HTML entities such as Ö when converted to plaintext where removed. Our html entity conversion function only converts &ouml and others to their corresponding unicode code, we however do not handle Ö in a generic way but have just appended them to the hashmap. The code can be simplified by creating a list of all possible html entity codes and replacing those in a loop.

       

      Generating emails with umlauts:

      server = kopano.Server()
      user = server.user('user1')
      item = user.inbox.create_item(subject='umlaut', html='<html><head></head><body><div>Ius efficiantur neglegentur liberavisse in, in sed error erant. &#196;st no aperiam qu&Auml;estio adolescens..<div/>'.encode(), message_class='IPM.Note', to=user.email, from_=user.email)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jvanderwaa Jelle van der Waa
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: