summaryrefslogtreecommitdiffstats
path: root/webapp/utils/markdown.jsx
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2016-08-03 19:28:38 -0400
committerenahum <nahumhbl@gmail.com>2016-08-03 18:28:38 -0500
commitc79685b0bc9686b41abcf295fdbe8f06d9e1771c (patch)
tree0989a6b975c9d2e1a0b1c863ae6a59f70bc6993a /webapp/utils/markdown.jsx
parent7b211f93a02c601d97d4b1fb8cef63bd69d42a2f (diff)
downloadchat-c79685b0bc9686b41abcf295fdbe8f06d9e1771c.tar.gz
chat-c79685b0bc9686b41abcf295fdbe8f06d9e1771c.tar.bz2
chat-c79685b0bc9686b41abcf295fdbe8f06d9e1771c.zip
PLT-3534 Changed special handling of internal links to only occur for permalinks and links to channels (#3731)
Diffstat (limited to 'webapp/utils/markdown.jsx')
-rw-r--r--webapp/utils/markdown.jsx6
1 files changed, 3 insertions, 3 deletions
diff --git a/webapp/utils/markdown.jsx b/webapp/utils/markdown.jsx
index e291ce546..028e667fd 100644
--- a/webapp/utils/markdown.jsx
+++ b/webapp/utils/markdown.jsx
@@ -151,9 +151,9 @@ class MattermostMarkdownRenderer extends marked.Renderer {
let output = '<a class="theme markdown__link" href="' + outHref + '" rel="noreferrer"';
- // special case for links that are inside the app
- if (outHref.startsWith(global.location.origin)) {
- output += ' data-link="' + outHref.substring(global.location.origin.length) + '"';
+ // special case for channel links and permalinks that are inside the app
+ if (new RegExp('^' + TextFormatting.escapeRegex(global.mm_config.SiteURL) + '\\/[^\\/]+\\/(pl|channels)\\/').test(outHref)) {
+ output += ' data-link="' + outHref.substring(global.mm_config.SiteURL.length) + '"';
} else {
output += ' target="_blank"';
}