mirror of
https://github.com/django/django.git
synced 2025-07-05 18:29:11 +00:00
magic-removal: Fixed #1270 -- Made the escape filter escape single quotes
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2738 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
213b6a6905
commit
980a522f9f
@ -25,7 +25,7 @@ def escape(html):
|
|||||||
"Returns the given HTML with ampersands, quotes and carets encoded"
|
"Returns the given HTML with ampersands, quotes and carets encoded"
|
||||||
if not isinstance(html, basestring):
|
if not isinstance(html, basestring):
|
||||||
html = str(html)
|
html = str(html)
|
||||||
return html.replace('&', '&').replace('<', '<').replace('>', '>').replace('"', '"')
|
return html.replace('&', '&').replace('<', '<').replace('>', '>').replace('"', '"').replace("'", ''')
|
||||||
|
|
||||||
def linebreaks(value):
|
def linebreaks(value):
|
||||||
"Converts newlines into <p> and <br />s"
|
"Converts newlines into <p> and <br />s"
|
||||||
|
@ -844,7 +844,8 @@ Escapes a string's HTML. Specifically, it makes these replacements:
|
|||||||
* ``"&"`` to ``"&"``
|
* ``"&"`` to ``"&"``
|
||||||
* ``<`` to ``"<"``
|
* ``<`` to ``"<"``
|
||||||
* ``>`` to ``">"``
|
* ``>`` to ``">"``
|
||||||
* ``'"'`` (double quote) to ``"""``
|
* ``'"'`` (double quote) to ``'"'``
|
||||||
|
* ``"'"`` (single quote) to ``'''``
|
||||||
|
|
||||||
filesizeformat
|
filesizeformat
|
||||||
~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~
|
||||||
|
Loading…
x
Reference in New Issue
Block a user