@@ -132,6 +132,22 @@ export const Reply = as<'div', ReplyProps>(
132132 let bodyJSX : ReactNode = fallbackBody ;
133133 let image : IconSrc | undefined ;
134134
135+ const replyLinkifyOpts = useMemo (
136+ ( ) => ( {
137+ ...LINKIFY_OPTS ,
138+ render : factoryRenderLinkifyWithMention ( ( href ) =>
139+ renderMatrixMention (
140+ mx ,
141+ room . roomId ,
142+ href ,
143+ makeMentionCustomProps ( mentionClickHandler ) ,
144+ nicknames
145+ )
146+ ) ,
147+ } ) ,
148+ [ mx , room . roomId , mentionClickHandler , nicknames ]
149+ ) ;
150+
135151 if ( format === 'org.matrix.custom.html' && formattedBody ) {
136152 const strippedHtml = trimReplyFromFormattedBody ( formattedBody )
137153 . replaceAll ( / < b r \s * \/ ? > / gi, ' ' )
@@ -140,21 +156,6 @@ export const Reply = as<'div', ReplyProps>(
140156 . replaceAll ( / < \/ l i > \s * < l i [ ^ > ] * > / gi, ' ' )
141157 . replaceAll ( / < \/ ? ( u l | o l | l i | b l o c k q u o t e | h [ 1 - 6 ] | p r e | d i v ) [ ^ > ] * > / gi, '' )
142158 . replaceAll ( / (?: \r \n | \r | \n ) / g, ' ' ) ;
143- const replyLinkifyOpts = useMemo (
144- ( ) => ( {
145- ...LINKIFY_OPTS ,
146- render : factoryRenderLinkifyWithMention ( ( href ) =>
147- renderMatrixMention (
148- mx ,
149- room . roomId ,
150- href ,
151- makeMentionCustomProps ( mentionClickHandler ) ,
152- nicknames
153- )
154- ) ,
155- } ) ,
156- [ mx , room . roomId , mentionClickHandler , nicknames ]
157- ) ;
158159 const parserOpts = getReactCustomHtmlParser ( mx , room . roomId , {
159160 linkifyOpts : replyLinkifyOpts ,
160161 useAuthentication,
0 commit comments