diff options
author | Christopher Speller <crspeller@gmail.com> | 2015-10-02 10:24:31 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2015-10-02 10:24:31 -0400 |
commit | c427e9c9d6fbd68662fdfbbe733af4b34ae69269 (patch) | |
tree | d6c1f9a221637ef2df26cba2b8539a2a521bfceb /web/react | |
parent | 2f60ab82a83c2ddf4bf2baf5eeb296d20f025ab4 (diff) | |
parent | fe8c04c973658a283daf0c761ffc47aaa233f260 (diff) | |
download | chat-c427e9c9d6fbd68662fdfbbe733af4b34ae69269.tar.gz chat-c427e9c9d6fbd68662fdfbbe733af4b34ae69269.tar.bz2 chat-c427e9c9d6fbd68662fdfbbe733af4b34ae69269.zip |
Merge pull request #912 from hmhealey/plt174
PLT-174 Added emailto: to the beginning of email links
Diffstat (limited to 'web/react')
-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; |