mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 10:07:48 +00:00
Add template and settings build options unit tests and tweak _.template docs.
Former-commit-id: c814799c82e5a1dde60e5eda4dda5cb192d437f9
This commit is contained in:
@@ -3685,7 +3685,7 @@
|
||||
* compiled({ 'name': 'moe' });
|
||||
* // => 'hello: moe'
|
||||
*
|
||||
* var list = '<% _.forEach(people, function(name) { %> <li><%= name %></li> <% }); %>';
|
||||
* var list = '<% _.forEach(people, function(name) { %><li><%= name %></li><% }); %>';
|
||||
* _.template(list, { 'people': ['moe', 'larry', 'curly'] });
|
||||
* // => '<li>moe</li><li>larry</li><li>curly</li>'
|
||||
*
|
||||
@@ -3694,12 +3694,12 @@
|
||||
* // => '<b><script></b>'
|
||||
*
|
||||
* // using the internal `print` function in "evaluate" delimiters
|
||||
* _.template('<% print("Hello " + epithet); %>', { 'epithet': 'stooge' });
|
||||
* _.template('<% print("Hello " + epithet); %>.', { 'epithet': 'stooge' });
|
||||
* // => 'Hello stooge.'
|
||||
*
|
||||
* // using custom template delimiter settings
|
||||
* _.templateSettings = {
|
||||
* 'interpolate': /\{\{(.+?)\}\}/g
|
||||
* 'interpolate': /\{\{([\s\S]+?)\}\}/g
|
||||
* };
|
||||
*
|
||||
* _.template('Hello {{ name }}!', { 'name': 'Mustache' });
|
||||
|
||||
Reference in New Issue
Block a user