Fixed #27900 -- Made escapejs escape backticks for use in ES6 template literals.
This commit is contained in:
parent
711123e1cd
commit
6ae1b04fb5
|
@ -58,6 +58,7 @@ _js_escapes = {
|
||||||
ord('='): '\\u003D',
|
ord('='): '\\u003D',
|
||||||
ord('-'): '\\u002D',
|
ord('-'): '\\u002D',
|
||||||
ord(';'): '\\u003B',
|
ord(';'): '\\u003B',
|
||||||
|
ord('`'): '\\u0060',
|
||||||
ord('\u2028'): '\\u2028',
|
ord('\u2028'): '\\u2028',
|
||||||
ord('\u2029'): '\\u2029'
|
ord('\u2029'): '\\u2029'
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,6 +140,7 @@ class TestUtilsHtml(SimpleTestCase):
|
||||||
'paragraph separator:\u2029and line separator:\u2028',
|
'paragraph separator:\u2029and line separator:\u2028',
|
||||||
'paragraph separator:\\u2029and line separator:\\u2028'
|
'paragraph separator:\\u2029and line separator:\\u2028'
|
||||||
),
|
),
|
||||||
|
('`', '\\u0060'),
|
||||||
)
|
)
|
||||||
for value, output in items:
|
for value, output in items:
|
||||||
with self.subTest(value=value, output=output):
|
with self.subTest(value=value, output=output):
|
||||||
|
|
Loading…
Reference in New Issue