Safe Link: Fix word break in message text (#4954)
This commit is contained in:
parent
a7ecd74fa4
commit
b9041b8fc3
@ -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 (
|
||||
|
||||
@ -555,6 +555,7 @@ function processEntity({
|
||||
<SafeLink
|
||||
url={getLinkUrl(entityText, entity)}
|
||||
text={entityText}
|
||||
withNormalWordBreak
|
||||
>
|
||||
{renderNestedMessagePart()}
|
||||
</SafeLink>
|
||||
|
||||
@ -940,7 +940,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
.long-word-break-all {
|
||||
.word-break-all {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user