mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 16:47:49 +00:00
Ensure _.template works with "interpolate" delimiters containing ternary operators. [closes #68]
Former-commit-id: 287df2ef5802ea6db743da5f211e480d6b0f85c9
This commit is contained in:
@@ -1499,6 +1499,11 @@
|
||||
var compiled = _.template('<span class="icon-<%= type %>2"></span>');
|
||||
equal(compiled({ 'type': 1 }), '<span class="icon-12"></span>');
|
||||
});
|
||||
|
||||
test('should work with "interpolate" delimiters containing ternary operators', function() {
|
||||
var compiled = _.template('<%= value ? value : "b" %>');
|
||||
equal(compiled({ 'value': 'a' }), 'a');
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
Reference in New Issue
Block a user