diff --git a/src/app/components/message/Reply.tsx b/src/app/components/message/Reply.tsx index 1d0cdd662..ccafd4c11 100644 --- a/src/app/components/message/Reply.tsx +++ b/src/app/components/message/Reply.tsx @@ -32,14 +32,7 @@ import { getReactionKey, getReactionShortcode, getRedactionTargetId } from '$uti import { getMxIdLocalPart } from '$utils/matrix'; import { randomNumberBetween } from '$utils/common'; import { sanitizeCustomHtml } from '$utils/sanitize'; -import { - getReactCustomHtmlParser, - scaleSystemEmoji, - LINKIFY_OPTS, - makeMentionCustomProps, - factoryRenderLinkifyWithMention, - renderMatrixMention, -} from '$plugins/react-custom-html-parser'; +import { getReactCustomHtmlParser, scaleSystemEmoji } from '$plugins/react-custom-html-parser'; import { useRoomEvent } from '$hooks/useRoomEvent'; import { useSableCosmetics } from '$hooks/useSableCosmetics'; import { useMediaAuthentication } from '$hooks/useMediaAuthentication'; @@ -332,24 +325,6 @@ export const Reply = as<'div', ReplyProps>( let image: ReactNode | undefined; let mentioned = sender != null && (mentions?.user_ids?.includes(sender) ?? false); - const replyLinkifyOpts = useMemo( - () => ({ - ...LINKIFY_OPTS, - render: factoryRenderLinkifyWithMention( - settingsLinkBaseUrl, - (href) => - renderMatrixMention( - mx, - room.roomId, - href, - makeMentionCustomProps(mentionClickHandler), - nicknames - ), - mentionClickHandler - ), - }), - [mx, room.roomId, mentionClickHandler, nicknames, settingsLinkBaseUrl] - ); if (eventType === M_POLL_START.name) { const question = ( replyEvent?.getContent()[M_POLL_START.name] as { @@ -364,7 +339,7 @@ export const Reply = as<'div', ReplyProps>( if (shouldParseReplyFormattedPreview(sanitizedHtml)) { const parserOpts = getReactCustomHtmlParser(mx, room.roomId, { settingsLinkBaseUrl, - linkifyOpts: replyLinkifyOpts, + linkifyOpts: undefined, useAuthentication, nicknames, handleMentionClick: mentionClickHandler, diff --git a/src/app/features/settings/cosmetics/ThemeCatalogSettings.tsx b/src/app/features/settings/cosmetics/ThemeCatalogSettings.tsx index f2a939305..d382c10fc 100644 --- a/src/app/features/settings/cosmetics/ThemeCatalogSettings.tsx +++ b/src/app/features/settings/cosmetics/ThemeCatalogSettings.tsx @@ -152,7 +152,60 @@ function CatalogTweakCard({ > - {displayName} + + {displayName} + + + {copyUrl && ( + { + handleCopy().catch(() => undefined); + }} + > + {menuIcon(copied ? Check : Link)} + + )} + {onExport && ( + { + onExport(); + }} + > + {menuIcon(Download)} + + )} + { + Promise.resolve(onToggleFavorite()).catch(() => undefined); + }} + > + {menuIcon(Star, { weight: isFavorited ? 'fill' : 'regular' })} + + + + {description} @@ -166,57 +219,6 @@ function CatalogTweakCard({ Third-party URL )} - - - {copyUrl && ( - { - handleCopy().catch(() => undefined); - }} - > - {menuIcon(copied ? Check : Link)} - - )} - {onExport && ( - { - onExport(); - }} - > - {menuIcon(Download)} - - )} - { - Promise.resolve(onToggleFavorite()).catch(() => undefined); - }} - > - {menuIcon(Star, { weight: isFavorited ? 'fill' : 'regular' })} - - - diff --git a/src/app/plugins/react-custom-html-parser.tsx b/src/app/plugins/react-custom-html-parser.tsx index ee0d62076..d2202a3e4 100644 --- a/src/app/plugins/react-custom-html-parser.tsx +++ b/src/app/plugins/react-custom-html-parser.tsx @@ -585,7 +585,7 @@ export const getReactCustomHtmlParser = ( roomId: string | undefined, params: { settingsLinkBaseUrl: string; - linkifyOpts: LinkifyOpts; + linkifyOpts?: LinkifyOpts; highlightRegex?: RegExp; handleSpoilerClick?: ReactEventHandler; handleMentionClick?: ReactEventHandler; @@ -828,6 +828,7 @@ export const getReactCustomHtmlParser = ( } } + if (!params.linkifyOpts) return {renderChildren()}; return {renderedChildren}; }