[Glitch] Fixes handled link formatting

Port c858fc77ef to glitch-soc

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Echo
2025-10-09 16:31:13 +02:00
committed by Claire
parent 3c3a812a9c
commit 8a50fb02ce
3 changed files with 60 additions and 34 deletions

View File

@@ -301,7 +301,7 @@ class StatusContent extends PureComponent {
this.node = c;
};
handleElement = (element, { key, ...props }) => {
handleElement = (element, { key, ...props }, children) => {
if (element instanceof HTMLAnchorElement) {
const mention = this.props.status.get('mentions').find(item => element.href === item.get('url'));
return (
@@ -312,7 +312,9 @@ class StatusContent extends PureComponent {
hashtagAccountId={this.props.status.getIn(['account', 'id'])}
mention={mention?.toJSON()}
key={key}
/>
>
{children}
</HandledLink>
);
} else if (element instanceof HTMLParagraphElement && element.classList.contains('quote-inline')) {
return null;