better default multiline-aware templates

This commit is contained in:
Jeremy Ashkenas
2010-10-05 17:10:44 -04:00
parent 5984be70c1
commit 348147d8fb
3 changed files with 12 additions and 2 deletions

View File

@@ -623,8 +623,8 @@
// By default, Underscore uses ERB-style template delimiters, change the
// following template settings to use alternative delimiters.
_.templateSettings = {
evaluate : /<%(.+?)%>/gm,
interpolate : /<%=(.+?)%>/gm
evaluate : /<%([\s\S]+?)%>/g,
interpolate : /<%=([\s\S]+?)%>/g
};
// JavaScript templating a-la ERB, pilfered from John Resig's