summaryrefslogtreecommitdiffstats
path: root/web/react
diff options
context:
space:
mode:
authorhmhealey <harrisonmhealey@gmail.com>2015-10-02 09:17:29 -0400
committerhmhealey <harrisonmhealey@gmail.com>2015-10-02 09:18:45 -0400
commitfe8c04c973658a283daf0c761ffc47aaa233f260 (patch)
treecc8eaa19df466be24485e15eed3b5d7634399923 /web/react
parent92404d6452758941ec96a559f7d8eee794fb1001 (diff)
downloadchat-fe8c04c973658a283daf0c761ffc47aaa233f260.tar.gz
chat-fe8c04c973658a283daf0c761ffc47aaa233f260.tar.bz2
chat-fe8c04c973658a283daf0c761ffc47aaa233f260.zip
Added emailto: to the beginning of email links
Diffstat (limited to 'web/react')
-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;