summaryrefslogtreecommitdiffstats
path: root/web/react/utils/markdown.jsx
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2015-10-14 19:24:24 -0700
committerCorey Hulen <corey@hulen.com>2015-10-14 19:24:24 -0700
commitd0b25363d144c49631da4c6b17e2493933b10138 (patch)
tree787a3d3ad46a5368ad9eb2c16f4bfc204cd695f1 /web/react/utils/markdown.jsx
parent94501476fa2cc59695da4dceafaaa77aa0de89a3 (diff)
parentb8c80c6d9520ec0af0407c576ee565df85fcc41f (diff)
downloadchat-d0b25363d144c49631da4c6b17e2493933b10138.tar.gz
chat-d0b25363d144c49631da4c6b17e2493933b10138.tar.bz2
chat-d0b25363d144c49631da4c6b17e2493933b10138.zip
Merge pull request #1053 from florianorben/markown_fix
Don't auto-add http:// to mailto: and ftp: markdown links
Diffstat (limited to 'web/react/utils/markdown.jsx')
-rw-r--r--web/react/utils/markdown.jsx2
1 files changed, 1 insertions, 1 deletions
diff --git a/web/react/utils/markdown.jsx b/web/react/utils/markdown.jsx
index 12d6dd424..2813798d2 100644
--- a/web/react/utils/markdown.jsx
+++ b/web/react/utils/markdown.jsx
@@ -32,7 +32,7 @@ export class MattermostMarkdownRenderer extends marked.Renderer {
link(href, title, text) {
let outHref = href;
- if (outHref.lastIndexOf('http', 0) !== 0) {
+ if (!(/^(mailto|https?|ftp)/.test(outHref))) {
outHref = `http://${outHref}`;
}