From b40b6c8160745e2cf6bb7e2d5514caf600c9aa87 Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Wed, 14 Jan 2026 16:58:15 +0100 Subject: [PATCH] fix: case-insensitive UUID matching in preprocessItemMentions UUIDs can contain both uppercase and lowercase hex characters (A-F, a-f). The regex was only matching lowercase, causing @mentions to not be converted to links in TextViewStatic. Co-Authored-By: Claude Opus 4.5 --- lib/src/Components/TipTap/utils/preprocessMarkdown.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/src/Components/TipTap/utils/preprocessMarkdown.ts b/lib/src/Components/TipTap/utils/preprocessMarkdown.ts index f447d9ce..b434387d 100644 --- a/lib/src/Components/TipTap/utils/preprocessMarkdown.ts +++ b/lib/src/Components/TipTap/utils/preprocessMarkdown.ts @@ -130,15 +130,16 @@ export function preprocessItemMentions(text: string): string { // Format with layer: [@Label](/item/layer/id) or [@Label](item/layer/id) // Use non-greedy matching for label to handle consecutive mentions + // Use case-insensitive flag for UUID hex characters result = result.replace( - /\[@([^\]]+?)\]\(\/?item\/[^/]+\/([a-f0-9-]+)\)/g, + /\[@([^\]]+?)\]\(\/?item\/[^/]+\/([a-fA-F0-9-]+)\)/g, '@$1', ) // Format without layer: [@Label](/item/id) or [@Label](item/id) - // UUID pattern: hex characters with dashes + // UUID pattern: hex characters (case-insensitive) with dashes result = result.replace( - /\[@([^\]]+?)\]\(\/?item\/([a-f0-9-]+)\)/g, + /\[@([^\]]+?)\]\(\/?item\/([a-fA-F0-9-]+)\)/g, '@$1', )