From cda81b79f212e0666782393c52ad19c2790c9446 Mon Sep 17 00:00:00 2001 From: David Date: Wed, 2 Feb 2022 18:12:09 +0000 Subject: [PATCH] Refs #32568 -- Optimized escape() by using SafeString instead of mark_safe(). --- django/utils/html.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/utils/html.py b/django/utils/html.py index d228e4c7bc..b6d6a01ce4 100644 --- a/django/utils/html.py +++ b/django/utils/html.py @@ -24,7 +24,7 @@ def escape(text): This may result in double-escaping. If this is a concern, use conditional_escape() instead. """ - return mark_safe(html.escape(str(text))) + return SafeString(html.escape(str(text))) _js_escapes = {