[FIX] Missing spaces on attachment (#21020)

pull/21051/head
Douglas Fabris 4 years ago committed by GitHub
parent e802fa59ce
commit 3901dcec3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      client/components/Message/Attachments/DefaultAttachment.tsx

@ -57,7 +57,15 @@ export const DefaultAttachment: FC<DefaultAttachmentProps> = (attachment) => {
{!collapsed && <>
{attachment.text && <Attachment.Text>{applyMardownFor('text', attachment.text)}</Attachment.Text>}
{/* {attachment.fields && <FieldsAttachment fields={attachment.mrkdwn_in?.includes('fields') ? attachment.fields.map(({ value, ...rest }) => ({ ...rest, value: <MarkdownText withRichContent={null} content={value} /> })) : attachment.fields} />} */}
{attachment.fields && <FieldsAttachment fields={attachment.fields.map(({ value, ...rest }) => ({ ...rest, value: <MarkdownText variant='inline' content={value as string} /> }))} />}
{attachment.fields && <FieldsAttachment fields={attachment.fields.map(({ value, ...rest }) => {
const cleanValue = (value as string).replace(/(.*)/g, (line: string) => {
if (line.trim() === '') {
return `${ line } <br/>`;
}
return `${ line } `;
});
return { ...rest, value: <MarkdownText variant='inline' content={cleanValue} /> };
})} />}
{attachment.image_url && <Attachment.Image {...attachment.image_dimensions as any} src={attachment.image_url} />}
{/* DEPRECATED */}
{isActionAttachment(attachment) && <ActionAttachment {...attachment} />}

Loading…
Cancel
Save