mirror of
https://github.com/django/django.git
synced 2025-10-24 22:26:08 +00:00
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user