diff --git a/app/assets/javascripts/app/lib/base/ba-linkify.js b/app/assets/javascripts/app/lib/base/ba-linkify.js index 293dd67af..911456236 100644 --- a/app/assets/javascripts/app/lib/base/ba-linkify.js +++ b/app/assets/javascripts/app/lib/base/ba-linkify.js @@ -161,7 +161,14 @@ window.linkify = (function(){ } // Push massaged link onto the array - parts.push([ link, href ]); + // 2018-10-30: me only link urls, not mailto link + //parts.push([ link, href ]); + if ( href && href.substr && href.substr(0,7) != 'mailto:') { + parts.push([ link, href ]); + } + else { + parts.push([ link, undefined ]); + } }; // Push remaining non-link text onto the array. diff --git a/public/assets/tests/html_utils.js b/public/assets/tests/html_utils.js index 10f2f1d48..40e6f01bf 100644 --- a/public/assets/tests/html_utils.js +++ b/public/assets/tests/html_utils.js @@ -269,6 +269,16 @@ test("linkify", function() { result = App.Utils.linkify(source) equal(result, should, source) + source = "test@example.com some text" + should = 'test@example.com some text' + result = App.Utils.linkify(source) + equal(result, should, source) + + source = "abc test@example.com some text" + should = 'abc test@example.com some text' + result = App.Utils.linkify(source) + equal(result, should, source) + /* source = "example.com" should = 'http://example.com'