From 3004d842d47f95de47fae34a1d94f381ec81a3bc Mon Sep 17 00:00:00 2001 From: newtextdoc1111 Date: Tue, 6 May 2025 00:48:06 +0900 Subject: [PATCH] enhance tag matching logic in findCompletionCandidates function --- web/js/autocomplete.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web/js/autocomplete.js b/web/js/autocomplete.js index 8397e54..87e2f25 100644 --- a/web/js/autocomplete.js +++ b/web/js/autocomplete.js @@ -559,7 +559,12 @@ function findCompletionCandidates(query) { // Check primary tag against all variations for (const variation of queryVariations) { // Ensure tagData.tag is treated as lowercase for comparison - if (tagData.tag.toLowerCase().includes(variation)) { + const lowerTag = tagData.tag.toLowerCase(); + if (lowerTag.includes(variation)) { + matched = true; + break; + } else if (lowerTag.replace(/[\-_]/g, '').includes(variation)) { + // Try to match with underscores removed matched = true; break; }