Permalink
Browse files

magic-removal: Fixed #1270 -- Made the escape filter escape single qu…

…otes

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2738 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 213b6a6 commit 980a522f9f5ba4774ebeef3fffb8722c481f9da2 @adrianholovaty adrianholovaty committed Apr 23, 2006
Showing with 3 additions and 2 deletions.
  1. +1 −1 django/utils/html.py
  2. +2 −1 docs/templates.txt
@@ -25,7 +25,7 @@ def escape(html):
"Returns the given HTML with ampersands, quotes and carets encoded"
if not isinstance(html, basestring):
html = str(html)
- return html.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;').replace('"', '&quot;')
+ return html.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;').replace('"', '&quot;').replace("'", '&#39;')
def linebreaks(value):
"Converts newlines into <p> and <br />s"
View
@@ -844,7 +844,8 @@ Escapes a string's HTML. Specifically, it makes these replacements:
* ``"&"`` to ``"&amp;"``
* ``<`` to ``"&lt;"``
* ``>`` to ``"&gt;"``
- * ``'"'`` (double quote) to ``"&quot;"``
+ * ``'"'`` (double quote) to ``'&quot;'``
+ * ``"'"`` (single quote) to ``'&#39;'``
filesizeformat
~~~~~~~~~~~~~~

0 comments on commit 980a522

Please sign in to comment.