update Ox.encodeEmailAddress

This commit is contained in:
rolux 2013-11-11 14:17:09 +01:00
parent fda5c7eaa2
commit 85ef28078b

View file

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