Fix escape char not interpreted in expressions

This commit is contained in:
Zaid Abdulla committed 2021-09-16 00:17:21 -07:00
1 parent 53bb4d3552
commit 7ae3bcdc0f
1 file changed
+1 -1
+1 -1
View File
@@ -29,7 +29,7 @@ function interpretEscapes(str): string {
r: "\r",
t: "\t",
};
return str.replace(/\\(u[0-9a-fA-F]{4}|[^u])/, (_, escape) => {
return str.replace(/\\(u[0-9a-fA-F]{4}|[^u])/g, (_, escape) => {
const type = escape.charAt(0);
const hex = escape.slice(1);
if (type === "u") return String.fromCharCode(parseInt(hex, 16));