diff options
Diffstat (limited to 'webapp/components/post_view/post_message_view')
-rw-r--r-- | webapp/components/post_view/post_message_view/post_message_view.jsx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/webapp/components/post_view/post_message_view/post_message_view.jsx b/webapp/components/post_view/post_message_view/post_message_view.jsx index d066183ff..76037741f 100644 --- a/webapp/components/post_view/post_message_view/post_message_view.jsx +++ b/webapp/components/post_view/post_message_view/post_message_view.jsx @@ -7,6 +7,7 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; import AtMention from 'components/at_mention'; +import MarkdownImage from 'components/markdown_image'; import store from 'stores/redux_store.jsx'; @@ -114,6 +115,22 @@ export default class PostMessageView extends React.PureComponent { } }, { + shouldProcessNode: (node) => node.type === 'tag' && node.name === 'img', + processNode: (node) => { + const { + class: className, + ...attribs + } = node.attribs; + + return ( + <MarkdownImage + className={className} + {...attribs} + /> + ); + } + }, + { shouldProcessNode: () => true, processNode: processNodeDefinitions.processDefaultNode } |