mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
adding a test for single quotes in templates
This commit is contained in:
@@ -34,9 +34,13 @@ $(document).ready(function() {
|
||||
var basicTemplate = _.template("<%= thing %> is gettin' on my noives!");
|
||||
var result = basicTemplate({thing : 'This'});
|
||||
equals(result, "This is gettin' on my noives!", 'can do basic attribute interpolation');
|
||||
|
||||
var fancyTemplate = _.template("<ul><% for (key in people) { %><li><%= people[key] %></li><% } %></ul>");
|
||||
result = fancyTemplate({people : {moe : "Moe", larry : "Larry", curly : "Curly"}});
|
||||
equals(result, "<ul><li>Moe</li><li>Larry</li><li>Curly</li></ul>", 'can run arbitrary javascript in templates');
|
||||
|
||||
var quoteTemplate = _.template("It's its, not it's");
|
||||
equals(quoteTemplate({}), "It's its, not it's");
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user