Skip to content

Commit

Permalink
Add tests for escaping \u2028 and \u2029.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Geiger committed Jun 16, 2014
1 parent 5b0a314 commit 3319a8c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,22 @@ test("Escaping", function() {
}
});

test("Escaping \\u2028", function() {
var text = "{{foo}}\u2028{{bar}}";
var t = Hogan.compile(text);
var s = t.render({foo: 'foo', bar: 'bar'});

is(s, "foo\u2028bar", "\\u2028 improperly escaped");
});

test("Escaping \\u2029", function() {
var text = "{{foo}}\u2029{{bar}}";
var t = Hogan.compile(text);
var s = t.render({foo: 'foo', bar: 'bar'});

is(s, "foo\u2029bar", "\\u2029 improperly escaped");
});

test("Mustache Injection", function() {
var text = "{{foo}}";
var t = Hogan.compile(text);
Expand Down

0 comments on commit 3319a8c

Please sign in to comment.