mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 07:47:49 +00:00
Merge pull request #401 from Stuk/template_js_fix
Fix escaped chars in Javascript in templates
This commit is contained in:
@@ -910,7 +910,8 @@
|
||||
})
|
||||
.replace(c.evaluate || null, function(match, code) {
|
||||
return "');" + code.replace(/\\'/g, "'")
|
||||
.replace(/[\r\n\t]/g, ' ') + ";__p.push('";
|
||||
.replace(/[\r\n\t]/g, ' ')
|
||||
.replace(/\\\\/g, '\\') + ";__p.push('";
|
||||
})
|
||||
.replace(/\r/g, '\\r')
|
||||
.replace(/\n/g, '\\n')
|
||||
|
||||
Reference in New Issue
Block a user