Bug 1202901 - Earlybird 42a2 email text from Outlook hidden by Lightning 4.4a2;r=philipp
authorMakeMyDay <makemyday@gmx-topmail.de>
Tue, 22 Sep 2015 21:46:21 +0200
changeset 26371 b508a45a0ba5f201e8081ef709c88992527dd21d
parent 26370 3094bab4c31f29b0adc9e6a559b2ea168964d34e
child 26372 3f3360ba6de355e75019e0cea759abf0ae872aee
child 26374 43b243847ecc274803ccdd7020a1e80d292d94ee
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersphilipp
bugs1202901
Bug 1202901 - Earlybird 42a2 email text from Outlook hidden by Lightning 4.4a2;r=philipp
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
+};