diff options
author | kpdecker <kpdecker@gmail.com> | 2013-03-31 16:27:11 -0500 |
---|---|---|
committer | kpdecker <kpdecker@gmail.com> | 2013-03-31 16:27:34 -0500 |
commit | 9e4b59e815b1f557c31fe5abc36b9be8aa0cf34a (patch) | |
tree | 38bb0fbd8d4da2447cd02357ea30a78a560696af /spec/qunit_spec.js | |
parent | bcc15ea5e78a3368344204c805e4666681e7253e (diff) | |
download | handlebars.js-9e4b59e815b1f557c31fe5abc36b9be8aa0cf34a.zip handlebars.js-9e4b59e815b1f557c31fe5abc36b9be8aa0cf34a.tar.gz handlebars.js-9e4b59e815b1f557c31fe5abc36b9be8aa0cf34a.tar.bz2 |
Add support for \\{ escapes
Fixes #456
Diffstat (limited to 'spec/qunit_spec.js')
-rw-r--r-- | spec/qunit_spec.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/qunit_spec.js b/spec/qunit_spec.js index f12e44c..3de9311 100644 --- a/spec/qunit_spec.js +++ b/spec/qunit_spec.js @@ -92,6 +92,12 @@ test("most basic", function() { shouldCompileTo("{{foo}}", { foo: "foo" }, "foo"); }); +test("escaping", function() { + shouldCompileTo("\\{{foo}}", { foo: "food" }, "{{foo}}"); + shouldCompileTo("\\\\{{foo}}", { foo: "food" }, "\\food"); + shouldCompileTo("\\\\ {{foo}}", { foo: "food" }, "\\\\ food"); +}); + test("compiling with a basic context", function() { shouldCompileTo("Goodbye\n{{cruel}}\n{{world}}!", {cruel: "cruel", world: "world"}, "Goodbye\ncruel\nworld!", "It works if all the required keys are provided"); |