summaryrefslogtreecommitdiffstats
path: root/web/react/utils/text_formatting.jsx
diff options
context:
space:
mode:
authorAsaad Mahmood <Unknowngi@live.com>2015-10-02 22:26:28 +0500
committerAsaad Mahmood <Unknowngi@live.com>2015-10-02 22:26:28 +0500
commitd8c5c4f7468bb07d8de904437726557c6fa9b436 (patch)
treec19af28e1ad6c2bf068bf64956461c25502f9bb3 /web/react/utils/text_formatting.jsx
parent813792dd600f4e485d52cc1066a8c1297578432d (diff)
parent41069d83d2b6ad5cca599f75292027e13d5b10f7 (diff)
downloadchat-d8c5c4f7468bb07d8de904437726557c6fa9b436.tar.gz
chat-d8c5c4f7468bb07d8de904437726557c6fa9b436.tar.bz2
chat-d8c5c4f7468bb07d8de904437726557c6fa9b436.zip
Merge branch 'master' of https://github.com/mattermost/platform into plt-375
Conflicts: web/react/components/user_settings/user_settings_appearance.jsx
Diffstat (limited to 'web/react/utils/text_formatting.jsx')
-rw-r--r--web/react/utils/text_formatting.jsx6
1 files changed, 4 insertions, 2 deletions
diff --git a/web/react/utils/text_formatting.jsx b/web/react/utils/text_formatting.jsx
index 56bf49c3f..34e42cbae 100644
--- a/web/react/utils/text_formatting.jsx
+++ b/web/react/utils/text_formatting.jsx
@@ -87,8 +87,10 @@ function autolinkUrls(text, tokens) {
const linkText = match.getMatchedText();
let url = linkText;
- if (url.lastIndexOf('http', 0) !== 0) {
- url = `http://${linkText}`;
+ if (match.getType() === 'email') {
+ url = `mailto:${url}`;
+ } else if (url.lastIndexOf('http', 0) !== 0) {
+ url = `http://${url}`;
}
const index = tokens.size;