1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Deprecated django.utils.text.javascript_quote.

Refs #21725.
This commit is contained in:
Baptiste Mispelon
2014-02-21 14:46:23 +01:00
parent 847171b0d0
commit 926e18d7d1
5 changed files with 44 additions and 13 deletions

View File

@@ -119,6 +119,8 @@ details on these changes.
* ``ssi`` and ``url`` template tags will be removed from the ``future`` template
tag library (used during the 1.3/1.4 deprecation period).
* ``django.utils.text.javascript_quote`` will be removed.
.. _deprecation-removed-in-1.8:
1.8

View File

@@ -1374,3 +1374,15 @@ Django 1.3 introduced ``{% load ssi from future %}`` and
:ttag:`ssi` and :ttag:`url` template tags. This syntax is now deprecated and
will be removed in Django 1.9. You can simply remove the
``{% load ... from future %}`` tags.
``django.utils.text.javascript_quote``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
``javascript_quote()`` was an undocumented function present in ``django.utils.text``.
It was used internally in the :ref:`javascript_catalog view <javascript_catalog-view>`
whose implementation was changed to make use of ``json.dumps()`` instead.
If you were relying on this function to provide safe output from untrusted
strings, you should use ``django.utils.html.escapejs`` or the
:tfilter:`escapejs` template filter.
If all you need is to generate valid javascript strings, you can simply use
``json.dumps()``.