Changeset - 494c793cc160
[Not reviewed]
default
0 2 0
Thomas De Schampheleire - 8 years ago 2018-02-12 09:34:17
thomas.de_schampheleire@nokia.com
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
2 files changed with 8 insertions and 8 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/helpers.py
Show inline comments
 
@@ -76,25 +76,25 @@ def canonical_hostname():
 
        return parts[1].split('/', 1)[0]
 

	
 

	
 
def html_escape(s):
 
    """Return string with all html escaped.
 
    This is also safe for javascript in html but not necessarily correct.
 
    """
 
    return (s
 
        .replace('&', '&')
 
        .replace(">", ">")
 
        .replace("<", "&lt;")
 
        .replace('"', "&quot;")
 
        .replace("'", "&apos;")
 
        .replace("'", "&#39;") # some mail readers use HTML 4 and doesn't support &apos;
 
        )
 

	
 
def js(value):
 
    """Convert Python value to the corresponding JavaScript representation.
 

	
 
    This is necessary to safely insert arbitrary values into HTML <script>
 
    sections e.g. using Mako template expression substitution.
 

	
 
    Note: Rather than using this function, it's preferable to avoid the
 
    insertion of values into HTML <script> sections altogether. Instead,
 
    data should (to the extent possible) be passed to JavaScript using
 
    data attributes or AJAX calls, eliminating the need for JS specific
kallithea/tests/models/test_dump_html_mails.ref.html
Show inline comments
 
@@ -85,25 +85,25 @@ View Comment: http://comment.org
 
        </td>
 
        <td width="20px" style="width:20px"></td>
 
    </tr>
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="3" style="border-bottom:1px solid #ddd"></td>
 
    </tr>
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="3"></td>
 
    </tr>
 
    <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>
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="3"></td>
 
    </tr>
 
</table>
 
        </td>
 
    </tr>
 
    <tr>
 
        <td height="30px" style="height:30px"></td>
 
    </tr>
 
@@ -244,25 +244,25 @@ View Comment: http://comment.org
 
        </td>
 
        <td width="20px" style="width:20px"></td>
 
    </tr>
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="3" style="border-bottom:1px solid #ddd"></td>
 
    </tr>
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="3"></td>
 
    </tr>
 
    <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>
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="3"></td>
 
    </tr>
 
</table>
 
        </td>
 
    </tr>
 
    <tr>
 
        <td height="30px" style="height:30px"></td>
 
    </tr>
 
@@ -421,25 +421,25 @@ View Comment: http://comment.org
 
            </td>
 
            <td width="20px" style="width:20px"></td>
 
        </tr>
 
        <tr>
 
            <td height="10px" style="height:10px" colspan="3" style="border-bottom:1px solid #ddd"></td>
 
        </tr>
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="3"></td>
 
    </tr>
 
    <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>
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="3"></td>
 
    </tr>
 
</table>
 
        </td>
 
    </tr>
 
    <tr>
 
        <td height="30px" style="height:30px"></td>
 
    </tr>
 
@@ -598,25 +598,25 @@ View Comment: http://comment.org
 
            </td>
 
            <td width="20px" style="width:20px"></td>
 
        </tr>
 
        <tr>
 
            <td height="10px" style="height:10px" colspan="3" style="border-bottom:1px solid #ddd"></td>
 
        </tr>
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="3"></td>
 
    </tr>
 
    <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>
 
    <tr>
 
        <td height="10px" style="height:10px" colspan="3"></td>
 
    </tr>
 
</table>
 
        </td>
 
    </tr>
 
    <tr>
 
        <td height="30px" style="height:30px"></td>
 
    </tr>
 
@@ -719,25 +719,25 @@ Subject: Test Message
 
    </tr>
 
</table>
 
                    </td>
 
                </tr>
 
                <tr>
 
                    <td height="30px" style="height:30px" colspan="3"></td>
 
                </tr>
 
                <tr>
 
                    <td></td>
 
                    <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>
 
                    <td></td>
 
                </tr>
 
                <tr>
 
                    <td height="30px" style="height:30px" colspan="3"></td>
 
                </tr>
 
            </table>
 
        </td>
 
        <td width="30px" style="width:30px"></td>
 
    </tr>
 
@@ -978,25 +978,25 @@ View Pull Request: http://pr.org/7
 
    </tr>
 
    <tr><td height="10px" style="height:10px"></td></tr>
 
    <tr>
 
        <td>
 
            <div>
 
                Description:
 
            </div>
 
        </td>
 
    </tr>
 
    <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>
 
    <tr>
 
        <td>
 
            <div>Changesets:</div>
 
        </td>
 
    </tr>
 
    <tr><td height="10px" style="height:10px"></td></tr>
 

	
 
    <tr>
 
        <td style="font-family:Helvetica,Arial,sans-serif">
 
@@ -1153,25 +1153,25 @@ View Pull Request: http://pr.org/7
 
    </tr>
 
    <tr><td height="10px" style="height:10px"></td></tr>
 
    <tr>
 
        <td>
 
            <div>
 
                Description:
 
            </div>
 
        </td>
 
    </tr>
 
    <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>
 
    <tr>
 
        <td>
 
            <div>Changesets:</div>
 
        </td>
 
    </tr>
 
    <tr><td height="10px" style="height:10px"></td></tr>
 

	
 
    <tr>
 
        <td style="font-family:Helvetica,Arial,sans-serif">
0 comments (0 inline, 0 general)