mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Fixed #21725 -- Fixed JavaScript quoting encoding.
Thanks to nedbatchelder for the report.
This commit is contained in:
parent
44814e78cc
commit
1c1dffca75
2 changed files with 6 additions and 1 deletions
|
@ -155,3 +155,8 @@ class TestUtilsText(SimpleTestCase):
|
|||
self.assertEqual(text.javascript_quote(input), '"Text"')
|
||||
self.assertEqual(text.javascript_quote(input, quote_double_quotes=True),
|
||||
'"Text"')
|
||||
|
||||
def test_javascript_quote_unicode(self):
|
||||
input = "<script>alert('Hello \\xff.\n Wel𝕃come\there\r');</script>"
|
||||
output = r"<script>alert(\'Hello \\xff.\n Wel𝕃come\there\r\');<\/script>"
|
||||
self.assertEqual(text.javascript_quote(input), output)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue