diff --git a/test/utility.js b/test/utility.js index f1f0bfb56..0f53bd510 100644 --- a/test/utility.js +++ b/test/utility.js @@ -51,6 +51,9 @@ $(document).ready(function() { var result = basicTemplate({thing : 'This'}); equals(result, "This is gettin' on my noives!", 'can do basic attribute interpolation'); + var sansSemicolonTemplate = _.template("A <% this %> B"); + equals(sansSemicolonTemplate(), "A B"); + var backslashTemplate = _.template("<%= thing %> is \\ridanculous"); equals(backslashTemplate({thing: 'This'}), "This is \\ridanculous"); diff --git a/underscore.js b/underscore.js index 3737ddc1b..9aced7791 100644 --- a/underscore.js +++ b/underscore.js @@ -893,7 +893,7 @@ }) .replace(c.evaluate || null, function(match, code) { return "');" + code.replace(/\\'/g, "'") - .replace(/[\r\n\t]/g, ' ') + "__p.push('"; + .replace(/[\r\n\t]/g, ' ') + ";__p.push('"; }) .replace(/\r/g, '\\r') .replace(/\n/g, '\\n')