Escape backslashes in template arguments (fixes #177)

This commit is contained in:
Josh Junon 2017-07-30 22:41:47 -07:00 committed by Josh Junon
parent 7a75399b72
commit fbd17e7a69

View file

@ -205,7 +205,7 @@ function chalkTag(chalk, strings) {
const parts = [strings.raw[0]];
for (let i = 1; i < strings.length; i++) {
parts.push(args[i - 1].toString().replace(/[{}]/g, '\\$&'));
parts.push(args[i - 1].toString().replace(/[{}\\]/g, '\\$&'));
parts.push(strings.raw[i]);
}