Loki: Fix parsing of escaped quotes in LogQL (#69584)

* fix parsing issue

* replace escaped quotes
This commit is contained in:
Sven Grossmann
2023-06-06 11:07:21 +02:00
committed by GitHub
parent 807c7d5b01
commit a81cee1d05
2 changed files with 35 additions and 2 deletions

View File

@@ -599,7 +599,10 @@ function isIntervalVariableError(node: SyntaxNode) {
function handleQuotes(string: string) {
if (string[0] === `"` && string[string.length - 1] === `"`) {
return string.replace(/"/g, '').replace(/\\\\/g, '\\');
return string
.substring(1, string.length - 1)
.replace(/\\"/g, '"')
.replace(/\\\\/g, '\\');
}
return string.replace(/`/g, '');
}