diff options
author | Corey Hulen <corey@hulen.com> | 2015-12-04 15:22:21 -0800 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2015-12-04 15:22:21 -0800 |
commit | 7aab27c8ec251d9ed300772cbcae5a7f909750f7 (patch) | |
tree | ec5aa97a50904e35f8f4c22fc41ba034450ae4e4 /web/react/utils/utils.jsx | |
parent | 8ae357c535d3f8068cd0e42ed00d48061e3ffa1d (diff) | |
parent | 975074b2ae2692f596edb263bb27727b43f33489 (diff) | |
download | chat-7aab27c8ec251d9ed300772cbcae5a7f909750f7.tar.gz chat-7aab27c8ec251d9ed300772cbcae5a7f909750f7.tar.bz2 chat-7aab27c8ec251d9ed300772cbcae5a7f909750f7.zip |
Merge pull request #1623 from mattermost/fixed-height-embeds
Fix embeds and add default fixed height
Diffstat (limited to 'web/react/utils/utils.jsx')
-rw-r--r-- | web/react/utils/utils.jsx | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index afe27ef96..f80da8415 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -252,13 +252,6 @@ export function getTimestamp() { // extracts links not styled by Markdown export function extractLinks(text) { - const urlMatcher = new Autolinker.matchParser.MatchParser({ - urls: true, - emails: false, - twitter: false, - phone: false, - hashtag: false - }); const links = []; let replaceText = text; @@ -271,7 +264,7 @@ export function extractLinks(text) { } } - function replaceFn(match) { + function replaceFn(autolinker, match) { let link = ''; const matchText = match.getMatchedText(); const tempText = replaceText; @@ -304,7 +297,16 @@ export function extractLinks(text) { links.push(link); } - urlMatcher.replace(text, replaceFn, this); + + Autolinker.link(text, { + replaceFn, + urls: true, + emails: false, + twitter: false, + phone: false, + hashtag: false + }); + return {links, text}; } |