mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-01-29 01:28:29 +00:00
display room mention text as they were sent
This commit is contained in:
parent
11ba1808a2
commit
2492bfa956
|
@ -74,7 +74,7 @@ const elementToInlineNode = (node: Element): MentionElement | EmoticonElement |
|
|||
if (typeof href !== 'string') return undefined;
|
||||
const [mxId] = parseMatrixToUrl(href);
|
||||
if (mxId) {
|
||||
return createMentionElement(mxId, mxId, false);
|
||||
return createMentionElement(mxId, parseNodeText(node) || mxId, false);
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
|
|
|
@ -180,10 +180,7 @@ export const getReactCustomHtmlParser = (
|
|||
mentionPrefix === '#'
|
||||
? getRoomWithCanonicalAlias(mx, mentionId)
|
||||
: mx.getRoom(mentionId);
|
||||
const mentionName = mentionRoom?.name;
|
||||
|
||||
const mentionDisplayName =
|
||||
mentionName && (mentionName.startsWith('#') ? mentionName : `#${mentionName}`);
|
||||
return (
|
||||
<span
|
||||
{...props}
|
||||
|
@ -198,7 +195,7 @@ export const getReactCustomHtmlParser = (
|
|||
onClick={params.handleMentionClick}
|
||||
style={{ cursor: 'pointer' }}
|
||||
>
|
||||
{mentionDisplayName ?? mentionId}
|
||||
{domToReact(children, opts)}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue