Skip to content

Commit

Permalink
Escape backslashes in template arguments (fixes #177)
Browse files Browse the repository at this point in the history
  • Loading branch information
Qix- committed Aug 7, 2017
1 parent 7a75399 commit fbd17e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -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]);
}

Expand Down

0 comments on commit fbd17e7

Please sign in to comment.