From 85ef28078bd8ae35a412053e59c9083515186cc5 Mon Sep 17 00:00:00 2001 From: rolux Date: Mon, 11 Nov 2013 14:17:09 +0100 Subject: [PATCH] update Ox.encodeEmailAddress --- source/Ox/js/HTML.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/Ox/js/HTML.js b/source/Ox/js/HTML.js index f8f97989..18a99cbf 100644 --- a/source/Ox/js/HTML.js +++ b/source/Ox/js/HTML.js @@ -188,8 +188,9 @@ > Ox.encodeEmailAddress('mailto:foo@bar.com').indexOf(':') > -1 true @*/ - Ox.encodeEmailAddress = function(string) { - var parts = ['mailto:' + string, string].map(function(part) { + Ox.encodeEmailAddress = function(address, text) { + text = text || address; + var parts = ['mailto:' + address, text].map(function(part) { return Ox.map(part, function(char) { var code = char.charCodeAt(0); return char == ':' ? ':'