From ad65e8cb03a9191203cd280290c13b49ebcd86c9 Mon Sep 17 00:00:00 2001 From: "Neil E. Pearson" Date: Tue, 25 Oct 2011 16:40:50 +1100 Subject: [PATCH] Fixed _.template() HTML escaping for when _ isn't in scope, due to noConflict() and minification. --- underscore.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/underscore.js b/underscore.js index 2462d767f..1f7df5ad5 100644 --- a/underscore.js +++ b/underscore.js @@ -899,8 +899,8 @@ .replace(/\n/g, '\\n') .replace(/\t/g, '\\t') + "');}return __p.join('');"; - var func = new Function('obj', tmpl); - return data ? func(data) : func; + var func = new Function('obj', '_', tmpl); + return data ? func(data, _) : function(data) { return func(data, _) }; }; // The OOP Wrapper