Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

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

Fix rendering of mentions in composer

+19 -14
+19 -14
src/view/com/composer/ComposePost.tsx
··· 108 108 : undefined 109 109 110 110 const textDecorated = useMemo(() => { 111 - return (text || '').split(/(\s)/g).map((item, i) => { 112 - if ( 113 - /^@[a-zA-Z0-9\.-]+$/g.test(item) && 114 - autocompleteView.knownHandles.has(item.slice(1)) 115 - ) { 116 - return ( 117 - <Text key={i} style={{color: colors.blue3}}> 118 - {item} 119 - </Text> 120 - ) 121 - } 122 - return item 123 - }) 111 + const re = /(@[a-z0-9\.]*)/gi 112 + const segments = [] 113 + let match 114 + let start = 0 115 + let i = 0 116 + while ((match = re.exec(text))) { 117 + segments.push(text.slice(start, match.index)) 118 + segments.push( 119 + <Text key={i++} style={{color: colors.blue3}}> 120 + {match[0]} 121 + </Text>, 122 + ) 123 + start = match.index + match[0].length 124 + } 125 + if (start < text.length) { 126 + segments.push(text.slice(start)) 127 + } 128 + return segments 124 129 }, [text]) 125 130 126 131 return ( ··· 194 199 ) 195 200 }) 196 201 197 - const atPrefixRegex = /@([\S]*)$/i 202 + const atPrefixRegex = /@([a-z0-9\.]*)$/i 198 203 function extractTextAutocompletePrefix(text: string) { 199 204 const match = atPrefixRegex.exec(text) 200 205 if (match) {