Fix room mention (#1459)
* create room mention with alias if possible * display room mention text as they were sent
This commit is contained in:
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user