From fe8c04c973658a283daf0c761ffc47aaa233f260 Mon Sep 17 00:00:00 2001 From: hmhealey Date: Fri, 2 Oct 2015 09:17:29 -0400 Subject: Added emailto: to the beginning of email links --- web/react/utils/text_formatting.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'web/react/utils') 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; -- cgit v1.2.3-1-g7c22