mirror of
https://github.com/django/django.git
synced 2025-09-22 02:02:46 +00:00
parent
847171b0d0
commit
926e18d7d1
5 changed files with 44 additions and 13 deletions
|
@ -4,6 +4,7 @@ import re
|
|||
import unicodedata
|
||||
from gzip import GzipFile
|
||||
from io import BytesIO
|
||||
import warnings
|
||||
|
||||
from django.utils.encoding import force_text
|
||||
from django.utils.functional import allow_lazy, SimpleLazyObject
|
||||
|
@ -327,6 +328,11 @@ ustring_re = re.compile("([\u0080-\uffff])")
|
|||
|
||||
|
||||
def javascript_quote(s, quote_double_quotes=False):
|
||||
msg = (
|
||||
"django.utils.text.javascript_quote() is deprecated. "
|
||||
"Use django.utils.html.escapejs() instead."
|
||||
)
|
||||
warnings.warn(msg, PendingDeprecationWarning, stacklevel=2)
|
||||
|
||||
def fix(match):
|
||||
return "\\u%04x" % ord(match.group(1))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue