summaryrefslogtreecommitdiffstats
path: root/web/react/utils/markdown.jsx
diff options
context:
space:
mode:
authorFlorian Orben <florian.orben@gmail.com>2015-10-14 20:21:25 +0200
committerFlorian Orben <florian.orben@gmail.com>2015-10-14 21:44:09 +0200
commitb8c80c6d9520ec0af0407c576ee565df85fcc41f (patch)
tree3e9f0c381371dc22bd3190afa7284ce0c8191072 /web/react/utils/markdown.jsx
parent830e8b04d9cbc5652ab8b23d469e1c75ff5f8516 (diff)
downloadchat-b8c80c6d9520ec0af0407c576ee565df85fcc41f.tar.gz
chat-b8c80c6d9520ec0af0407c576ee565df85fcc41f.tar.bz2
chat-b8c80c6d9520ec0af0407c576ee565df85fcc41f.zip
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}`;
}