Added JS escaping for newline, linefeed, return, tab and backspace. Closes #1
This commit is contained in:
parent
a0ebfe2566
commit
0d14c27032
2 changed files with 10 additions and 0 deletions
|
@ -55,6 +55,10 @@ class TestEncode {
|
|||
t.setAttribute(TestCase.FOO, "'\"\\/");
|
||||
assertThat(t.getContent()).isEqualTo("\\'\\\"\\\\\\/");
|
||||
|
||||
t = TemplateFactory.TXT.get("encodeJs");
|
||||
t.setAttribute(TestCase.FOO, "This is\f\b a\r\n\ttest");
|
||||
assertThat(t.getContent()).isEqualTo("This is\\f\\b a\\r\\n\\ttest");
|
||||
|
||||
t = TemplateFactory.HTML.get("encodeJs");
|
||||
t.setAttribute(TestCase.FOO, '"' + TestCase.SAMPLE_TEXT + '"');
|
||||
assertThat(t.getContent()).as("with unicode")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue