From ffb7ab55be29ee1e9c2a1cfef13f715cb9f61371 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Fri, 9 Aug 2024 07:41:52 -0700 Subject: [PATCH] Fix variable regex --- index.html | 2 +- src-web/components/core/Editor/twig/placeholder.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index b8f93e38..73eacd89 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ Yaak App - + diff --git a/src-web/components/core/Editor/twig/placeholder.ts b/src-web/components/core/Editor/twig/placeholder.ts index 27bf3540..a546e3ce 100644 --- a/src-web/components/core/Editor/twig/placeholder.ts +++ b/src-web/components/core/Editor/twig/placeholder.ts @@ -36,7 +36,7 @@ class PlaceholderWidget extends WidgetType { export const placeholders = function (variables: { name: string }[]) { const placeholderMatcher = new BetterMatchDecorator({ - regexp: /\$\{\[\s*([^\]]+)\s*]}/g, + regexp: /\$\{\[\s*([^\]\s]+)\s*]}/g, decoration(match, view, matchStartPos) { const matchEndPos = matchStartPos + match[0].length - 1; @@ -55,6 +55,7 @@ export const placeholders = function (variables: { name: string }[]) { } const isFunction = groupMatch.includes('('); + console.log('VAIRABLES', variables, groupMatch); return Decoration.replace({ inclusive: true, widget: new PlaceholderWidget(