grain.social is a photo sharing platform built on atproto. grain.social
atproto photography appview
57
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: prevent bare domain regex from matching inside mentions

The lookbehind on bareDomainRe didn't include dots, so for handles
like @tessa.germnetwork.com, "germnetwork.com" was matched as a bare
domain instead of being part of the full mention.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+1 -1
+1 -1
app/lib/components/atoms/RichText.svelte
··· 8 8 let { text }: { text: string } = $props() 9 9 10 10 const urlRe = /https?:\/\/[^\s<>[\]()]+/g 11 - const bareDomainRe = /(?<![/@\w])([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}(\/[^\s<>[\]()]*)?/g 11 + const bareDomainRe = /(?<![/@\w.])([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}(\/[^\s<>[\]()]*)?/g 12 12 const mentionRe = /@([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?/g 13 13 const hashtagRe = /#([a-zA-Z][a-zA-Z0-9_]*)/g 14 14