summaryrefslogtreecommitdiffstats
path: root/web/react
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-10-02 10:24:31 -0400
committerChristopher Speller <crspeller@gmail.com>2015-10-02 10:24:31 -0400
commitc427e9c9d6fbd68662fdfbbe733af4b34ae69269 (patch)
treed6c1f9a221637ef2df26cba2b8539a2a521bfceb /web/react
parent2f60ab82a83c2ddf4bf2baf5eeb296d20f025ab4 (diff)
parentfe8c04c973658a283daf0c761ffc47aaa233f260 (diff)
downloadchat-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.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;