summaryrefslogtreecommitdiffstats
path: root/web/react/utils/text_formatting.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/text_formatting.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/text_formatting.jsx')
-rw-r--r--web/react/utils/text_formatting.jsx2
1 files changed, 1 insertions, 1 deletions
diff --git a/web/react/utils/text_formatting.jsx b/web/react/utils/text_formatting.jsx
index 2b6e6e14e..d79aeed68 100644
--- a/web/react/utils/text_formatting.jsx
+++ b/web/react/utils/text_formatting.jsx
@@ -89,7 +89,7 @@ function autolinkUrls(text, tokens) {
if (match.getType() === 'email') {
url = `mailto:${url}`;
- } else if (url.lastIndexOf('http', 0) !== 0) {
+ } else if (!(/^(mailto|https?|ftp)/.test(url))) {
url = `http://${url}`;
}