merging a variant of svieira's fix for preserving whitespace within templates.

This commit is contained in:
Jeremy Ashkenas
2010-07-20 13:37:27 -04:00
parent ef396a9e13
commit b2b5a5390b
2 changed files with 9 additions and 4 deletions

View File

@@ -69,6 +69,9 @@ $(document).ready(function() {
var quoteInStatementAndBody = _.template("<% if(foo == 'bar'){ %>Statement quotes and 'quotes'.<% } %>");
equals(quoteInStatementAndBody({foo: "bar"}), "Statement quotes and 'quotes'.");
var withNewlinesAndTabs = _.template('This\n\t\tis: <%= x %>.\n\tok.\nend.');
equals(withNewlinesAndTabs({x: 'that'}), 'This\n\t\tis: that.\n\tok.\nend.');
_.templateSettings = {
start : '{{',
end : '}}',