From f73daebb61311efb966afdff75034a7f9c710fbf Mon Sep 17 00:00:00 2001
From: Harrison Healey <harrisonmhealey@gmail.com>
Date: Fri, 22 Apr 2016 14:52:44 -0400
Subject: PLT-1236 Added special handling for markdown links within mattermost
 (#2763)

* Added special handling for markdown links within mattermost

* Moved application of .app__body class to route components
---
 webapp/utils/text_formatting.jsx | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'webapp/utils/text_formatting.jsx')

diff --git a/webapp/utils/text_formatting.jsx b/webapp/utils/text_formatting.jsx
index 4c8b5e24c..3aa82ccdc 100644
--- a/webapp/utils/text_formatting.jsx
+++ b/webapp/utils/text_formatting.jsx
@@ -2,6 +2,7 @@
 // See License.txt for license information.
 
 import Autolinker from 'autolinker';
+import {browserHistory} from 'react-router';
 import Constants from './constants.jsx';
 import * as Emoticons from './emoticons.jsx';
 import * as Markdown from './markdown.jsx';
@@ -398,10 +399,13 @@ function replaceNewlines(text) {
 export function handleClick(e) {
     const mentionAttribute = e.target.getAttributeNode('data-mention');
     const hashtagAttribute = e.target.getAttributeNode('data-hashtag');
+    const linkAttribute = e.target.getAttributeNode('data-link');
 
     if (mentionAttribute) {
         Utils.searchForTerm(mentionAttribute.value);
     } else if (hashtagAttribute) {
         Utils.searchForTerm(hashtagAttribute.value);
+    } else if (linkAttribute) {
+        browserHistory.push(linkAttribute.value);
     }
 }
-- 
cgit v1.2.3-1-g7c22

