Bug 1202901 - Earlybird 42a2 email text from Outlook hidden by Lightning 4.4a2. r=philipp a=aleth
authorMakeMyDay <makemyday@gmx-topmail.de>
Wed, 09 Sep 2015 21:43:55 +0200
changeset 18415 5e95881b6b2511415a53c349b65c08513979f582
parent 18414 1e3775a9c8aea1918f8f18fe45ea1c8a3aee47b0
child 18416 990bb78f92846d729b4cba846d0a0f6ea6fceb40
push id11277
push useraleth@instantbird.org
push dateMon, 21 Sep 2015 22:01:34 +0000
treeherdercomm-central@5e95881b6b25 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersphilipp, aleth
bugs1202901
Bug 1202901 - Earlybird 42a2 email text from Outlook hidden by Lightning 4.4a2. r=philipp a=aleth
calendar/lightning/modules/ltnInvitationUtils.jsm
--- a/calendar/lightning/modules/ltnInvitationUtils.jsm
+++ b/calendar/lightning/modules/ltnInvitationUtils.jsm
@@ -85,20 +85,23 @@ ltn.invitation = {
                 let labelText = ltn.getString("lightning", "imipHtml." + aField, null);
                 descr.textContent = labelText;
             }
 
             if (aContentText) {
                 let content = doc.getElementById("imipHtml-" + aField + "-content");
                 doc.getElementById("imipHtml-" + aField + "-row").hidden = false;
                 if (aConvert) {
-                    let mode = Components.interfaces.mozITXTToHTMLConv.kStructPhrase +
-                               Components.interfaces.mozITXTToHTMLConv.kGlyphSubstitution +
-                               Components.interfaces.mozITXTToHTMLConv.kURLs;
-                    content.innerHTML = linkConverter.scanHTML(aContentText, mode);
+                    // we convert special characters first to not mix up html conversion
+                    let mode = Components.interfaces.mozITXTToHTMLConv.kEntities;
+                    let contentText = linkConverter.scanTXT(aContentText, mode);
+                    mode = Components.interfaces.mozITXTToHTMLConv.kStructPhrase +
+                           Components.interfaces.mozITXTToHTMLConv.kGlyphSubstitution +
+                           Components.interfaces.mozITXTToHTMLConv.kURLs;
+                    content.innerHTML = linkConverter.scanHTML(contentText, mode);
                 } else {
                     content.textContent = aContentText;
                 }
             }
         }
 
         // Simple fields
         let headerDescr = doc.getElementById("imipHtml-header-descr");
@@ -342,9 +345,9 @@ ltn.invitation = {
         aOldDoc = cal.xml.parseString(aOldDoc);
         aNewDoc = cal.xml.parseString(aNewDoc);
         let doc = aNewDoc.cloneNode(true);
         // elements to consider for comparison
         ['summary', 'location', 'when', 'canceledOccurrences',
          'modifiedOccurrences', 'organizer', 'attendee'].forEach(_compareElement);
         return cal.xml.serializeDOM(doc);
     }
-};
\ No newline at end of file
+};