Fixing Issue #35. newlines in evaluated code.

This commit is contained in:
Jeremy Ashkenas
2010-09-27 17:35:43 -04:00
parent 902f1192e0
commit fbd682d9ec
3 changed files with 22 additions and 26 deletions

View File

@@ -1065,17 +1065,15 @@ _.template(list, {people : ['moe', 'curly', 'larry']});
<p>
If ERB-style delimiters aren't your cup of tea, you can change Underscore's
template settings to use different symbols to set off interpolated code.
Define <b>start</b> and <b>end</b> tokens, and an <b>interpolate</b> regex
to match expressions that should be evaluated and inserted. For example,
to perform
Define and an <b>interpolate</b> regex, and an (optional) <b>evaluate</b> regex
to match expressions that should be inserted and evaluated, respectively.
For example, to perform
<a href="http://github.com/janl/mustache.js#readme">Mustache.js</a>
style templating:
</p>
<pre>
_.templateSettings = {
start : '{{',
end : '}}',
interpolate : /\{\{(.+?)\}\}/g
};