From d412144f88a24925af8500d9b1b7535e518a3eb6 Mon Sep 17 00:00:00 2001
From: =Corey Hulen <corey@hulen.com>
Date: Thu, 8 Oct 2015 09:14:13 -0700
Subject: Adding removing blank target for browser links

---
 web/react/utils/text_formatting.jsx | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

(limited to 'web/react/utils/text_formatting.jsx')

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
         });
 
-- 
cgit v1.2.3-1-g7c22


From e640bf7b6c1f6b3f20db954b27430261c18accda Mon Sep 17 00:00:00 2001
From: =Corey Hulen <corey@hulen.com>
Date: Thu, 8 Oct 2015 09:34:49 -0700
Subject: Fixing issue with lastIndexOf

---
 web/react/utils/text_formatting.jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'web/react/utils/text_formatting.jsx')

diff --git a/web/react/utils/text_formatting.jsx b/web/react/utils/text_formatting.jsx
index 43b212484..b8ed58258 100644
--- a/web/react/utils/text_formatting.jsx
+++ b/web/react/utils/text_formatting.jsx
@@ -97,7 +97,7 @@ function autolinkUrls(text, tokens) {
         const alias = `MM_LINK${index}`;
 
         var target = 'target="_blank"';
-        if (url.lastIndexOf(Utils.getTeamURLFromAddressBar()) === 0) {
+        if (url.lastIndexOf(Utils.getTeamURLFromAddressBar(), 0) === 0) {
             target = '';
         }
 
-- 
cgit v1.2.3-1-g7c22

