Code

Ticket #1270: html.diff

File html.diff, 606 bytes (added by scum, 8 years ago)

[patch] added unicode replacement (\u0027) to single quotes

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("'","\u0027")
11 
12 def linebreaks(value):
13     "Converts newlines into <p> and <br />s"