From b5404001104e550a7b955655583b9ed25bbe15fe Mon Sep 17 00:00:00 2001 From: Dominik Reh Date: Fri, 10 Feb 2023 12:23:52 +0100 Subject: [PATCH] Allow spaces in wildcard file names --- javascript/ext_wildcards.js | 2 +- javascript/tagAutocomplete.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/javascript/ext_wildcards.js b/javascript/ext_wildcards.js index 22a2944..b4eae15 100644 --- a/javascript/ext_wildcards.js +++ b/javascript/ext_wildcards.js @@ -1,5 +1,5 @@ // Regex -const WC_REGEX = /\b__([^, ]+)__([^, ]*)\b/g; +const WC_REGEX = /\b__([^,]+)__([^, ]*)\b/g; // Trigger conditions const WC_TRIGGER = () => CFG.useWildcards && [...tagword.matchAll(WC_REGEX)].length > 0; diff --git a/javascript/tagAutocomplete.js b/javascript/tagAutocomplete.js index d6b54dc..4f32f12 100644 --- a/javascript/tagAutocomplete.js +++ b/javascript/tagAutocomplete.js @@ -287,8 +287,9 @@ function isEnabled() { const WEIGHT_REGEX = /[([]([^,()[\]:| ]+)(?::(?:\d+(?:\.\d+)?|\.\d+))?[)\]]/g; const POINTY_REGEX = /<[^\s,<](?:[^\t\n\r,<>]*>|[^\t\n\r,> ]*)/g; +const COMPLETED_WILDCARD_REGEX = /__[^\s,_][^\t\n\r,_]*[^\s,_]__[^\s,_]*/g; const NORMAL_TAG_REGEX = /[^\s,|<>]+|