Code

Ticket #1270: html.2.diff

File html.2.diff, 606 bytes (added by Malcolm Tredinnick <malcolm@…>, 8 years ago)

Updated patch using &#39;.

Line 
1Index: html.py
2===================================================================
3--- html.py     (revision 1927)
4+++ html.py     (working copy)
5@@ -24,7 +24,7 @@
6     "Returns the given HTML with ampersands, quotes and carets encoded"
7     if not isinstance(html, basestring):
8         html = str(html)
9-    return html.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;').replace('"', '&quot;')
10+    return html.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;').replace('"', '&quot;').replace("'","&#39;")
11 
12 def linebreaks(value):
13     "Converts newlines into <p> and <br />s"