mirror of
https://github.com/astuto/astuto.git
synced 2025-12-16 11:47:56 +01:00
Add markdown support (#115)
This commit is contained in:
committed by
GitHub
parent
78049a820c
commit
35c427d9f6
@@ -1,6 +1,7 @@
|
||||
import * as React from 'react';
|
||||
import I18n from 'i18n-js';
|
||||
import ReactMarkdown from 'react-markdown';
|
||||
import Gravatar from 'react-gravatar';
|
||||
import I18n from 'i18n-js';
|
||||
|
||||
import { BoxTitleText, DangerText, CenteredMutedText, MutedText } from '../shared/CustomTexts';
|
||||
import Spinner from '../shared/Spinner';
|
||||
@@ -46,9 +47,15 @@ const PostUpdateList = ({
|
||||
<span>{postUpdate.userFullName}</span>
|
||||
</div>
|
||||
|
||||
<p className="postUpdateListItemBody">
|
||||
<div className="postUpdateListItemBody">
|
||||
{ 'body' in postUpdate ?
|
||||
postUpdate.body
|
||||
<ReactMarkdown
|
||||
className="postUpdateBody"
|
||||
disallowedTypes={['heading', 'image', 'html']}
|
||||
unwrapDisallowed
|
||||
>
|
||||
{postUpdate.body}
|
||||
</ReactMarkdown>
|
||||
:
|
||||
<React.Fragment>
|
||||
<i>{I18n.t('post.updates_box.status_change')}</i>
|
||||
@@ -57,7 +64,7 @@ const PostUpdateList = ({
|
||||
/>
|
||||
</React.Fragment>
|
||||
}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<MutedText>{friendlyDate(postUpdate.updatedAt)}</MutedText>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user