mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-19 15:21:23 +02:00
Fix variable regex
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
<meta charset="UTF-8"/>
|
<meta charset="UTF-8"/>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||||
<title>Yaak App</title>
|
<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
|
<!-- Certain elements like webview (and maybe <select>?) will use background
|
||||||
color depending on document background color-->
|
color depending on document background color-->
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class PlaceholderWidget extends WidgetType {
|
|||||||
|
|
||||||
export const placeholders = function (variables: { name: string }[]) {
|
export const placeholders = function (variables: { name: string }[]) {
|
||||||
const placeholderMatcher = new BetterMatchDecorator({
|
const placeholderMatcher = new BetterMatchDecorator({
|
||||||
regexp: /\$\{\[\s*([^\]]+)\s*]}/g,
|
regexp: /\$\{\[\s*([^\]\s]+)\s*]}/g,
|
||||||
decoration(match, view, matchStartPos) {
|
decoration(match, view, matchStartPos) {
|
||||||
const matchEndPos = matchStartPos + match[0].length - 1;
|
const matchEndPos = matchStartPos + match[0].length - 1;
|
||||||
|
|
||||||
@@ -55,6 +55,7 @@ export const placeholders = function (variables: { name: string }[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const isFunction = groupMatch.includes('(');
|
const isFunction = groupMatch.includes('(');
|
||||||
|
console.log('VAIRABLES', variables, groupMatch);
|
||||||
return Decoration.replace({
|
return Decoration.replace({
|
||||||
inclusive: true,
|
inclusive: true,
|
||||||
widget: new PlaceholderWidget(
|
widget: new PlaceholderWidget(
|
||||||
|
|||||||
Reference in New Issue
Block a user