diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2016-04-22 14:52:44 -0400 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2016-04-22 11:52:44 -0700 |
commit | f73daebb61311efb966afdff75034a7f9c710fbf (patch) | |
tree | 0ad2923ade2991586a6f72a90d4a5148bba61be7 /webapp/utils/text_formatting.jsx | |
parent | e80bf13f48a9dba6815558ded39356b1cff584d2 (diff) | |
download | chat-f73daebb61311efb966afdff75034a7f9c710fbf.tar.gz chat-f73daebb61311efb966afdff75034a7f9c710fbf.tar.bz2 chat-f73daebb61311efb966afdff75034a7f9c710fbf.zip |
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
Diffstat (limited to 'webapp/utils/text_formatting.jsx')
-rw-r--r-- | webapp/utils/text_formatting.jsx | 4 |
1 files changed, 4 insertions, 0 deletions
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); } } |