Fixed quoted term not processing starting & ending quotes

This commit is contained in:
koloml committed 2026-06-14 00:32:47 +04:00
1 parent 8c4c32c4bf
commit 40aa02ff70
1 file changed
+4 -2
+4 -2
View File
@@ -41,11 +41,13 @@ export class QuotedTermToken extends Token {
}
static decode(value: string): string {
return value.replace(/\\([\\"])/g, "$1");
return value
.replaceAll(/\\([\\"])/g, "$1")
.replaceAll(/^"|"$/g, '');
}
static encode(value: string): string {
return value.replace(/[\\"]/g, "\\$&");
return `"${value.replaceAll(/[\\"]/g, "\\$&")}"`;
}
}