mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2026-02-06 09:55:47 +00:00
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 <noreply@anthropic.com>
This commit is contained in:
parent
b944a7f401
commit
b40b6c8160
@ -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,
|
||||
'<span data-item-mention data-label="$1" data-id="$2">@$1</span>',
|
||||
)
|
||||
|
||||
// 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,
|
||||
'<span data-item-mention data-label="$1" data-id="$2">@$1</span>',
|
||||
)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user