diff options
author | =Corey Hulen <corey@hulen.com> | 2015-10-08 09:14:13 -0700 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2015-10-08 09:14:13 -0700 |
commit | d412144f88a24925af8500d9b1b7535e518a3eb6 (patch) | |
tree | 47bf73765f13d1d9ef2d45a66ee3f5e6ea123c39 /web/react/utils/text_formatting.jsx | |
parent | f548e0ffb9a6b956b9732ae1ceab58a54b03d203 (diff) | |
download | chat-d412144f88a24925af8500d9b1b7535e518a3eb6.tar.gz chat-d412144f88a24925af8500d9b1b7535e518a3eb6.tar.bz2 chat-d412144f88a24925af8500d9b1b7535e518a3eb6.zip |
Adding removing blank target for browser links
Diffstat (limited to 'web/react/utils/text_formatting.jsx')
-rw-r--r-- | web/react/utils/text_formatting.jsx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/web/react/utils/text_formatting.jsx b/web/react/utils/text_formatting.jsx index 34e42cbae..43b212484 100644 --- a/web/react/utils/text_formatting.jsx +++ b/web/react/utils/text_formatting.jsx @@ -96,8 +96,13 @@ function autolinkUrls(text, tokens) { const index = tokens.size; const alias = `MM_LINK${index}`; + var target = 'target="_blank"'; + if (url.lastIndexOf(Utils.getTeamURLFromAddressBar()) === 0) { + target = ''; + } + tokens.set(alias, { - value: `<a class='theme' target='_blank' href='${url}'>${linkText}</a>`, + value: '<a class="theme"' + target + ' href="${url}">${linkText}</a>', originalText: linkText }); |