diff options
author | hmhealey <harrisonmhealey@gmail.com> | 2015-10-02 09:17:29 -0400 |
---|---|---|
committer | hmhealey <harrisonmhealey@gmail.com> | 2015-10-02 09:18:45 -0400 |
commit | fe8c04c973658a283daf0c761ffc47aaa233f260 (patch) | |
tree | cc8eaa19df466be24485e15eed3b5d7634399923 /web/react/utils/text_formatting.jsx | |
parent | 92404d6452758941ec96a559f7d8eee794fb1001 (diff) | |
download | chat-fe8c04c973658a283daf0c761ffc47aaa233f260.tar.gz chat-fe8c04c973658a283daf0c761ffc47aaa233f260.tar.bz2 chat-fe8c04c973658a283daf0c761ffc47aaa233f260.zip |
Added emailto: to the beginning of email links
Diffstat (limited to 'web/react/utils/text_formatting.jsx')
-rw-r--r-- | web/react/utils/text_formatting.jsx | 6 |
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; |