From 5af6abb06d21c531385dd62255490a74ba2b0e05 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Sun, 6 Nov 2022 12:29:44 +0100 Subject: [PATCH] advanced syntaxes: ignores quotes around file path in `IMPORT{}` --- CHANGELOG.md | 1 + src/client/widgets/common/widget.js | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e1c1c3d..8b67e308 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - bug fixes - scripting: prevent some functions to be marked as undefined + - advanced syntaxes: ignores quotes around file path in `IMPORT{}` - misc - change noFocus client option behavior: the defalt client window now doesn't take the focus at all, even when a text input is clicked. diff --git a/src/client/widgets/common/widget.js b/src/client/widgets/common/widget.js index f8da3084..6d3a6b1c 100644 --- a/src/client/widgets/common/widget.js +++ b/src/client/widgets/common/widget.js @@ -759,6 +759,12 @@ class Widget extends EventEmitter { }) propValue = balancedReplace('IMPORT', '{', '}', propValue, (file)=>{ + if ( + // remove quotes + (file[0] === '"' && file[file.length - 1] === '"') || + (file[0] === '\'' && file[file.length - 1] === '\'') + ) file = file.slice(1, file.length - 1) + if (storeLinks) { if (!this.fragments[file]) this.fragments[file] = [] if (!this.fragments[file].includes(propName)) this.fragments[file].push(propName)