Escape backslashes in template arguments (fixes #177)
This commit is contained in:
parent
7a75399b72
commit
fbd17e7a69
1 changed files with 1 additions and 1 deletions
2
index.js
2
index.js
|
|
@ -205,7 +205,7 @@ function chalkTag(chalk, strings) {
|
||||||
const parts = [strings.raw[0]];
|
const parts = [strings.raw[0]];
|
||||||
|
|
||||||
for (let i = 1; i < strings.length; i++) {
|
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]);
|
parts.push(strings.raw[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue