From b8c80c6d9520ec0af0407c576ee565df85fcc41f Mon Sep 17 00:00:00 2001 From: Florian Orben Date: Wed, 14 Oct 2015 20:21:25 +0200 Subject: Don't auto-add http:// to mailto: and ftp: markdown links --- web/react/utils/markdown.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web/react/utils/markdown.jsx') 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}`; } -- cgit v1.2.3-1-g7c22