changeset 7152:494c793cc160

lib: change ' to ' to satisfy Outlook HTML rendering The HTML entity ' (') did not exist in the HTML 4 spec [1] and was only added later. As Outlook (and Thunderbird) uses an old engine to render HTML and CSS, it does not recognize this entity and treats it as a literal string. Therefore, use the equivalent ' code which should be recognized by all browsers, even those restricted to HTML 4. [1] https://www.w3.org/TR/html4/sgml/entities.html
author Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
date Mon, 12 Feb 2018 09:34:17 +0100
parents cbfc29a4c363
children bf11fd471e5a
files kallithea/lib/helpers.py kallithea/tests/models/test_dump_html_mails.ref.html
diffstat 2 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/lib/helpers.py	Mon Feb 12 09:29:01 2018 +0100
+++ b/kallithea/lib/helpers.py	Mon Feb 12 09:34:17 2018 +0100
@@ -85,7 +85,7 @@
         .replace(">", "&gt;")
         .replace("<", "&lt;")
         .replace('"', "&quot;")
-        .replace("'", "&apos;")
+        .replace("'", "&#39;") # some mail readers use HTML 4 and doesn't support &apos;
         )
 
 def js(value):
--- a/kallithea/tests/models/test_dump_html_mails.ref.html	Mon Feb 12 09:29:01 2018 +0100
+++ b/kallithea/tests/models/test_dump_html_mails.ref.html	Mon Feb 12 09:34:17 2018 +0100
@@ -94,7 +94,7 @@
     <tr>
         <td width="20px" style="width:20px"></td>
         <td>
-            <div style="font-family:Lucida Console,Consolas,Monaco,Inconsolata,Liberation Mono,monospace;white-space:pre-wrap"><div class="formatted-fixed">This is the new &apos;comment&apos;.<br/><br/> - and here it ends indented.</div></div>
+            <div style="font-family:Lucida Console,Consolas,Monaco,Inconsolata,Liberation Mono,monospace;white-space:pre-wrap"><div class="formatted-fixed">This is the new &#39;comment&#39;.<br/><br/> - and here it ends indented.</div></div>
         </td>
         <td width="20px" style="width:20px"></td>
     </tr>
@@ -253,7 +253,7 @@
     <tr>
         <td width="20px" style="width:20px"></td>
         <td>
-            <div style="font-family:Lucida Console,Consolas,Monaco,Inconsolata,Liberation Mono,monospace;white-space:pre-wrap"><div class="formatted-fixed">This is the new &apos;comment&apos;.<br/><br/> - and here it ends indented.</div></div>
+            <div style="font-family:Lucida Console,Consolas,Monaco,Inconsolata,Liberation Mono,monospace;white-space:pre-wrap"><div class="formatted-fixed">This is the new &#39;comment&#39;.<br/><br/> - and here it ends indented.</div></div>
         </td>
         <td width="20px" style="width:20px"></td>
     </tr>
@@ -430,7 +430,7 @@
     <tr>
         <td width="20px" style="width:20px"></td>
         <td>
-            <div style="font-family:Lucida Console,Consolas,Monaco,Inconsolata,Liberation Mono,monospace;white-space:pre-wrap"><div class="formatted-fixed">This is the new &apos;comment&apos;.<br/><br/> - and here it ends indented.</div></div>
+            <div style="font-family:Lucida Console,Consolas,Monaco,Inconsolata,Liberation Mono,monospace;white-space:pre-wrap"><div class="formatted-fixed">This is the new &#39;comment&#39;.<br/><br/> - and here it ends indented.</div></div>
         </td>
         <td width="20px" style="width:20px"></td>
     </tr>
@@ -607,7 +607,7 @@
     <tr>
         <td width="20px" style="width:20px"></td>
         <td>
-            <div style="font-family:Lucida Console,Consolas,Monaco,Inconsolata,Liberation Mono,monospace;white-space:pre-wrap"><div class="formatted-fixed">This is the new &apos;comment&apos;.<br/><br/> - and here it ends indented.</div></div>
+            <div style="font-family:Lucida Console,Consolas,Monaco,Inconsolata,Liberation Mono,monospace;white-space:pre-wrap"><div class="formatted-fixed">This is the new &#39;comment&#39;.<br/><br/> - and here it ends indented.</div></div>
         </td>
         <td width="20px" style="width:20px"></td>
     </tr>
@@ -728,7 +728,7 @@
                     <td>
 <table cellpadding="0" cellspacing="0" border="0" width="100%">
     <tr>
-        <td style="font-family:Lucida Console,Consolas,Monaco,Inconsolata,Liberation Mono,monospace;white-space:pre-wrap"><div class="formatted-fixed">This is the &apos;body&apos; of the &quot;test&quot; message<br/> - nothing interesting here except indentation.</div></td>
+        <td style="font-family:Lucida Console,Consolas,Monaco,Inconsolata,Liberation Mono,monospace;white-space:pre-wrap"><div class="formatted-fixed">This is the &#39;body&#39; of the &quot;test&quot; message<br/> - nothing interesting here except indentation.</div></td>
     </tr>
 </table>
                     </td>
@@ -987,7 +987,7 @@
     <tr><td height="10px" style="height:10px"></td></tr>
     <tr>
         <td>
-            <div style="font-family:Lucida Console,Consolas,Monaco,Inconsolata,Liberation Mono,monospace;white-space:pre-wrap;color:#395fa0"><div class="formatted-fixed">This PR is &apos;awesome&apos; because it does &lt;stuff&gt;<br/> - please approve indented!</div></div>
+            <div style="font-family:Lucida Console,Consolas,Monaco,Inconsolata,Liberation Mono,monospace;white-space:pre-wrap;color:#395fa0"><div class="formatted-fixed">This PR is &#39;awesome&#39; because it does &lt;stuff&gt;<br/> - please approve indented!</div></div>
         </td>
     </tr>
     <tr><td height="15px" style="height:15px"></td></tr>
@@ -1162,7 +1162,7 @@
     <tr><td height="10px" style="height:10px"></td></tr>
     <tr>
         <td>
-            <div style="font-family:Lucida Console,Consolas,Monaco,Inconsolata,Liberation Mono,monospace;white-space:pre-wrap;color:#395fa0"><div class="formatted-fixed">This PR is &apos;awesome&apos; because it does &lt;stuff&gt;<br/> - please approve indented!</div></div>
+            <div style="font-family:Lucida Console,Consolas,Monaco,Inconsolata,Liberation Mono,monospace;white-space:pre-wrap;color:#395fa0"><div class="formatted-fixed">This PR is &#39;awesome&#39; because it does &lt;stuff&gt;<br/> - please approve indented!</div></div>
         </td>
     </tr>
     <tr><td height="15px" style="height:15px"></td></tr>