diff --git a/lib/compiler.js b/lib/compiler.js index aebd15a4..e672e6f5 100644 --- a/lib/compiler.js +++ b/lib/compiler.js @@ -233,7 +233,7 @@ }, format: function(context, node) { - return '.w(' + escape(node[1] + node[2]) + ')'; + return '.w(' + escape(node[1]) + ')'; }, reference: function(context, node) { diff --git a/test/jasmine-test/spec/coreTests.js b/test/jasmine-test/spec/coreTests.js index 33202bac..94dd4e94 100755 --- a/test/jasmine-test/spec/coreTests.js +++ b/test/jasmine-test/spec/coreTests.js @@ -1776,7 +1776,39 @@ var coreTests = [ { name: "whitespace test", tests: [ - { + { + name: "whitespace on: whitespace-only template", + source: "\n ", + context: {}, + expected: "\n ", + message: "whitespace on: whitespace-only template is preserved", + config: { whitespace: true } + }, + { + name: "whitespace off: whitespace-only template", + source: "\n ", + context: {}, + expected: "", + message: "whitespace off: whitespace-only template is removed", + config: { whitespace: false } + }, + { + name: "whitespace on: whitespace-only block", + source: "{", " foo bar baz",