From cc6a9d494d77ff910064d17719848445c05642ee Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Wed, 5 Oct 2011 16:19:00 -0400 Subject: [PATCH] Merging in escaping for Underscore templates, using <%- syntax. Sorry Eco. --- test/utility.js | 4 ++++ underscore.js | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/test/utility.js b/test/utility.js index 58368a13e..976b3b996 100644 --- a/test/utility.js +++ b/test/utility.js @@ -81,6 +81,10 @@ $(document).ready(function() { var withNewlinesAndTabs = _.template('This\n\t\tis: <%= x %>.\n\tok.\nend.'); equals(withNewlinesAndTabs({x: 'that'}), 'This\n\t\tis: that.\n\tok.\nend.'); + var template = _.template("<%- value %>"); + var result = template({value: "