mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 23:37:49 +00:00
Fixes #369 -- adding extra semicolons to templtes in case you forget.
This commit is contained in:
@@ -51,6 +51,9 @@ $(document).ready(function() {
|
||||
var result = basicTemplate({thing : 'This'});
|
||||
equals(result, "This is gettin' on my noives!", 'can do basic attribute interpolation');
|
||||
|
||||
var sansSemicolonTemplate = _.template("A <% this %> B");
|
||||
equals(sansSemicolonTemplate(), "A B");
|
||||
|
||||
var backslashTemplate = _.template("<%= thing %> is \\ridanculous");
|
||||
equals(backslashTemplate({thing: 'This'}), "This is \\ridanculous");
|
||||
|
||||
|
||||
@@ -893,7 +893,7 @@
|
||||
})
|
||||
.replace(c.evaluate || null, function(match, code) {
|
||||
return "');" + code.replace(/\\'/g, "'")
|
||||
.replace(/[\r\n\t]/g, ' ') + "__p.push('";
|
||||
.replace(/[\r\n\t]/g, ' ') + ";__p.push('";
|
||||
})
|
||||
.replace(/\r/g, '\\r')
|
||||
.replace(/\n/g, '\\n')
|
||||
|
||||
Reference in New Issue
Block a user