mirror of
https://github.com/django/django.git
synced 2025-10-26 15:16:09 +00:00
More attacking E302 violators
This commit is contained in:
@@ -56,11 +56,13 @@ _js_escapes = {
|
||||
# Escape every ASCII character with a value less than 32.
|
||||
_js_escapes.update((ord('%c' % z), '\\u%04X' % z) for z in range(32))
|
||||
|
||||
|
||||
def escapejs(value):
|
||||
"""Hex encodes characters for use in JavaScript strings."""
|
||||
return mark_safe(force_text(value).translate(_js_escapes))
|
||||
escapejs = allow_lazy(escapejs, six.text_type)
|
||||
|
||||
|
||||
def conditional_escape(text):
|
||||
"""
|
||||
Similar to escape(), except that it doesn't operate on pre-escaped strings.
|
||||
|
||||
Reference in New Issue
Block a user