From 2dea567dcfcdfcd016c0da55a120c6e854760fb0 Mon Sep 17 00:00:00 2001
From: Harrison Healey <harrisonmhealey@gmail.com>
Date: Wed, 28 Jun 2017 10:30:02 -0400
Subject: Added MarkdownImage component (#6774)

* Added MarkdownImage component

* Fixed unit tests
---
 .../post_view/post_message_view/post_message_view.jsx   | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

(limited to 'webapp/components/post_view/post_message_view/post_message_view.jsx')

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';
 
@@ -113,6 +114,22 @@ export default class PostMessageView extends React.PureComponent {
                     return <AtMention mentionName={mentionName}/>;
                 }
             },
+            {
+                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
-- 
cgit v1.2.3-1-g7c22

