diff --git a/django/utils/html.py b/django/utils/html.py index 18c650fb06..25843ce576 100644 --- a/django/utils/html.py +++ b/django/utils/html.py @@ -58,6 +58,7 @@ _js_escapes = { ord('='): '\\u003D', ord('-'): '\\u002D', ord(';'): '\\u003B', + ord('`'): '\\u0060', ord('\u2028'): '\\u2028', ord('\u2029'): '\\u2029' } diff --git a/tests/utils_tests/test_html.py b/tests/utils_tests/test_html.py index ae020289f2..08b31bc55a 100644 --- a/tests/utils_tests/test_html.py +++ b/tests/utils_tests/test_html.py @@ -140,6 +140,7 @@ class TestUtilsHtml(SimpleTestCase): 'paragraph separator:\u2029and line separator:\u2028', 'paragraph separator:\\u2029and line separator:\\u2028' ), + ('`', '\\u0060'), ) for value, output in items: with self.subTest(value=value, output=output):