Stories: Only render text link if it's a valid URL
This commit is contained in:
parent
2ee7b18d33
commit
733c5b598f
3 changed files with 40 additions and 3 deletions
|
@ -12,7 +12,7 @@ import { Emojify } from './conversation/Emojify';
|
|||
import { StoryLinkPreview } from './StoryLinkPreview';
|
||||
import { TextAttachmentStyleType } from '../types/Attachment';
|
||||
import { count } from '../util/grapheme';
|
||||
import { getSafeDomain } from '../types/LinkPreview';
|
||||
import { isValidLink, getSafeDomain } from '../types/LinkPreview';
|
||||
import { getFontNameByTextScript } from '../util/getFontNameByTextScript';
|
||||
import {
|
||||
COLOR_WHITE_INT,
|
||||
|
@ -197,7 +197,7 @@ export const TextAttachment = forwardRef<HTMLTextAreaElement, PropsType>(
|
|||
the story, but it must be positioned using the scaled offset
|
||||
*/}
|
||||
{textAttachment.preview &&
|
||||
textAttachment.preview.url &&
|
||||
isValidLink(textAttachment.preview.url) &&
|
||||
linkPreviewOffsetTop &&
|
||||
!isThumbnail && (
|
||||
<a
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue