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 == ':' ? ':'