Fix variable regex

This commit is contained in:
Gregory Schier
2024-08-09 07:41:52 -07:00
parent c3970ba756
commit 7f3492a1f0
2 changed files with 3 additions and 2 deletions

View File

@@ -4,7 +4,7 @@
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Yaak App</title>
<script src="http://localhost:8097"></script>
<!-- <script src="http://localhost:8097"></script>-->
<!-- Certain elements like webview (and maybe <select>?) will use background
color depending on document background color-->

View File

@@ -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(