diff options
| author | Tim Graham <timograham@gmail.com> | 2019-02-05 09:38:29 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2019-02-06 14:12:06 -0500 |
| commit | 77d25dbd0f20d6a907c805ffae8aaadd87edbacf (patch) | |
| tree | a082b53101084fb57bbd8d0fb69a3663e4e70057 /django/utils/html.py | |
| parent | d55e88292723764a16f0689c73bc7e739dfa6047 (diff) | |
Refs #27753 -- Favored SafeString over SafeText.
Diffstat (limited to 'django/utils/html.py')
| -rw-r--r-- | django/utils/html.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/django/utils/html.py b/django/utils/html.py index 44a3f16459..9c519978f5 100644 --- a/django/utils/html.py +++ b/django/utils/html.py @@ -9,7 +9,7 @@ from urllib.parse import ( from django.utils.functional import Promise, keep_lazy, keep_lazy_text from django.utils.http import RFC3986_GENDELIMS, RFC3986_SUBDELIMS -from django.utils.safestring import SafeData, SafeText, mark_safe +from django.utils.safestring import SafeData, SafeString, mark_safe from django.utils.text import normalize_newlines # Configuration for urlize() function. @@ -33,7 +33,7 @@ _html_escapes = { } -@keep_lazy(str, SafeText) +@keep_lazy(str, SafeString) def escape(text): """ Return the given text with ampersands, quotes and angle brackets encoded @@ -65,7 +65,7 @@ _js_escapes = { _js_escapes.update((ord('%c' % z), '\\u%04X' % z) for z in range(32)) -@keep_lazy(str, SafeText) +@keep_lazy(str, SafeString) def escapejs(value): """Hex encode characters for use in JavaScript strings.""" return mark_safe(str(value).translate(_js_escapes)) @@ -372,7 +372,7 @@ def avoid_wrapping(value): def html_safe(klass): """ A decorator that defines the __html__ method. This helps non-Django - templates to detect classes whose __str__ methods return SafeText. + templates to detect classes whose __str__ methods return SafeString. """ if '__html__' in klass.__dict__: raise ValueError( |
