fix(editor): Escape node names with quotes in autocomplete and drag'n'drop (#8663)

This commit is contained in:
Elias Meire
2024-02-21 10:43:34 +01:00
committed by GitHub
parent c346002cc6
commit 890c2bd52b
5 changed files with 35 additions and 9 deletions

View File

@@ -11,6 +11,7 @@ import {
} from './utils';
import type { Completion, CompletionContext, CompletionResult } from '@codemirror/autocomplete';
import { useExternalSecretsStore } from '@/stores/externalSecrets.ee.store';
import { escapeMappingString } from '@/utils/mappingUtils';
/**
* Completions offered at the dollar position: `$|`
@@ -90,7 +91,7 @@ export function dollarOptions() {
})
.concat(
autocompletableNodeNames().map((nodeName) => ({
label: `$('${nodeName}')`,
label: `$('${escapeMappingString(nodeName)}')`,
type: 'keyword',
info: i18n.baseText('codeNodeEditor.completer.$()', { interpolate: { nodeName } }),
})),