just highlight emails with domains containing a period.

While a domain "localhost" is valid, it's very annoying as most PS1
prompts are in the form 'user@hostname' and terminology will highlight
them. To avoid so just create links for user@hostname.something



SVN revision: 77647
This commit is contained in:
Gustavo Sverzut Barbieri 2012-10-09 14:50:01 +00:00
parent 52af5639d7
commit 5bfed09e13
2 changed files with 10 additions and 4 deletions

View File

@ -119,9 +119,13 @@ _activate_link(Evas_Object *obj)
path = sd->link.string; path = sd->link.string;
if (!strncasecmp(sd->link.string, "file://", 7)) path = path + 7; if (!strncasecmp(sd->link.string, "file://", 7)) path = path + 7;
} }
else if (strchr(sd->link.string, '@')) else
email = EINA_TRUE; {
const char *at = strchr(sd->link.string, '@');
if (at && (strchr(at + 1, '.')))
email = EINA_TRUE;
}
s = eina_str_escape(sd->link.string); s = eina_str_escape(sd->link.string);
if (!s) return; if (!s) return;
if (email) if (email)

View File

@ -160,7 +160,9 @@ _termio_link_find(Evas_Object *obj, int cx, int cy, int *x1r, int *y1r, int *x2r
} }
if ((!isspace(s[0])) && (len > 1)) if ((!isspace(s[0])) && (len > 1))
{ {
if ((strchr(s, '@')) || const char *at = strchr(s, '@');
if ((at && (strchr(at + 1, '.'))) ||
(!strncasecmp(s, "http://", 7))|| (!strncasecmp(s, "http://", 7))||
(!strncasecmp(s, "https://", 8)) || (!strncasecmp(s, "https://", 8)) ||
(!strncasecmp(s, "ftp://", 6)) || (!strncasecmp(s, "ftp://", 6)) ||