From 7217b51452a089b808142ade04da8dafb01c180b Mon Sep 17 00:00:00 2001 From: Nick Peihl Date: Tue, 15 Oct 2024 15:05:24 -0400 Subject: [PATCH] [Canvas] Fix unescaped backslashes (#196311) Fixes unescaped backslashes in Canvas autocomplete --- .../public/components/expression_input/autocomplete.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/presentation_util/public/components/expression_input/autocomplete.ts b/src/plugins/presentation_util/public/components/expression_input/autocomplete.ts index 16d0e10127403..ae317c48dd87b 100644 --- a/src/plugins/presentation_util/public/components/expression_input/autocomplete.ts +++ b/src/plugins/presentation_util/public/components/expression_input/autocomplete.ts @@ -439,7 +439,7 @@ function maybeQuote(value: any) { if (value.match(/^\{.*\}$/)) { return value; } - return `"${value.replace(/"/g, '\\"')}"`; + return `"${value.replace(/[\\"]/g, '\\$&')}"`; } return value; }