change to global replacement

This commit is contained in:
Jörg Breitbart
2024-10-03 22:10:40 +02:00
parent 41640d9402
commit 15a63bae22
+1 -1
View File
@@ -25,7 +25,7 @@ function quote(s: string): string {
const pos = s.match(/([-_a-zA-Z0-9\xA0-\u{10FFFF}]+)/u);
const neg = s.match(/^(-?\d|--)/m);
if (!neg && pos && pos[1] === s) return s;
return `"${s.replace('"', '\\"')}"`;
return `"${s.replace(/"/g, '\\"')}"`;
}