Safe Link: Fix word break in message text (#4954)

This commit is contained in:
zubiden 2024-09-06 15:43:37 +02:00 committed by Alexander Zinchuk
parent a7ecd74fa4
commit b9041b8fc3
3 changed files with 5 additions and 2 deletions

View File

@ -18,6 +18,7 @@ type OwnProps = {
text: string;
className?: string;
children?: TeactNode;
withNormalWordBreak?: boolean;
isRtl?: boolean;
};
@ -26,6 +27,7 @@ const SafeLink = ({
text,
className,
children,
withNormalWordBreak,
isRtl,
}: OwnProps) => {
const { openUrl } = getActions();
@ -48,7 +50,7 @@ const SafeLink = ({
const classNames = buildClassName(
className || 'text-entity-link',
text.length > 50 && 'long-word-break-all',
!withNormalWordBreak && 'word-break-all',
);
return (

View File

@ -555,6 +555,7 @@ function processEntity({
<SafeLink
url={getLinkUrl(entityText, entity)}
text={entityText}
withNormalWordBreak
>
{renderNestedMessagePart()}
</SafeLink>

View File

@ -940,7 +940,7 @@
}
}
.long-word-break-all {
.word-break-all {
word-break: break-all;
}