diff options
Diffstat (limited to 'webapp/utils/markdown.jsx')
-rw-r--r-- | webapp/utils/markdown.jsx | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/webapp/utils/markdown.jsx b/webapp/utils/markdown.jsx index dff425e1f..f2b5bcc39 100644 --- a/webapp/utils/markdown.jsx +++ b/webapp/utils/markdown.jsx @@ -2,7 +2,6 @@ // See License.txt for license information. import * as TextFormatting from './text_formatting.jsx'; -import * as Utils from './utils.jsx'; import * as syntaxHightlighting from './syntax_hightlighting.jsx'; import marked from 'marked'; @@ -137,18 +136,20 @@ class MattermostMarkdownRenderer extends marked.Renderer { outHref = `http://${outHref}`; } - let output = '<a class="theme markdown__link" href="' + outHref + '"'; - if (title) { - output += ' title="' + title + '"'; - } + let output = '<a class="theme markdown__link" '; - if (outHref.lastIndexOf(Utils.getTeamURLFromAddressBar(), 0) === 0) { - output += '>'; + // special case for links that are inside the app + if (outHref.startsWith(global.location.origin)) { + output += 'data-link="' + outHref.substring(global.location.origin.length) + '"'; } else { - output += ' target="_blank">'; + output += 'href="' + outHref + '"'; + } + + if (title) { + output += ' title="' + title + '"'; } - output += outText + '</a>'; + output += '>' + outText + '</a>'; return prefix + output + suffix; } |