diff options
author | Jon Trowbridge <trow@ximian.com> | 2001-04-24 10:51:45 +0800 |
---|---|---|
committer | Jon Trowbridge <trow@src.gnome.org> | 2001-04-24 10:51:45 +0800 |
commit | 038d1a932ce339985c91b05c2be35d512f7cef71 (patch) | |
tree | 83a183c4f1b31ec9bbbc1e0421753946f7617236 /e-util/e-html-utils.c | |
parent | e37b58efec96ce102e8c354a979a2b37d28249c7 (diff) | |
download | gsoc2013-evolution-038d1a932ce339985c91b05c2be35d512f7cef71.tar gsoc2013-evolution-038d1a932ce339985c91b05c2be35d512f7cef71.tar.gz gsoc2013-evolution-038d1a932ce339985c91b05c2be35d512f7cef71.tar.bz2 gsoc2013-evolution-038d1a932ce339985c91b05c2be35d512f7cef71.tar.lz gsoc2013-evolution-038d1a932ce339985c91b05c2be35d512f7cef71.tar.xz gsoc2013-evolution-038d1a932ce339985c91b05c2be35d512f7cef71.tar.zst gsoc2013-evolution-038d1a932ce339985c91b05c2be35d512f7cef71.zip |
Removed attempts to use Radek's evil <DATA> hacks, which were just causing
2001-04-23 Jon Trowbridge <trow@ximian.com>
* e-html-utils.c (e_text_to_html_full): Removed attempts to use
Radek's evil <DATA> hacks, which were just causing me
(and GtkHTML) grief.
2001-04-23 Jon Trowbridge <trow@ximian.com>
* gui/component/e-address-popup.c: Lots of code has been
simplified here.
(e_address_popup_factory_new_control): Rather than directly pop
our control up in a window (via the e_address_popup_popup
function, which is now gone), just return the widget and let the
caller do the popping. This works better, since it means we don't
have to work around the vagaries of bonobo focus & event handling.
(e_address_popup_set_name): Refresh when both name & email have
been set, rather than checking a stupid counter.
(e_address_popup_set_email): Ditto.
2001-04-23 Jon Trowbridge <trow@ximian.com>
* mail-display.c (html_button_press_event): Check for mailto:
links, and pop up our mail address menu when we find one.
(make_popup_window): The main piece of code (ignoring a zillion
little callbacks) to pop up our windows with reasonable semantics
for having them close automatically.
(mail_text_write): Enable converting addresses to mailto links
in message bodies.
* mail-format.c (write_address): Simplify code, removing Radek's
<DATA> hacks. Write out addresses as mailto: links.
svn path=/trunk/; revision=9534
Diffstat (limited to 'e-util/e-html-utils.c')
-rw-r--r-- | e-util/e-html-utils.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/e-util/e-html-utils.c b/e-util/e-html-utils.c index 4bcfc920b0..c9c116e754 100644 --- a/e-util/e-html-utils.c +++ b/e-util/e-html-utils.c @@ -65,12 +65,15 @@ url_extract (const unsigned char **text, gboolean check) return out; } -/* FIXME */ +/* FIXME -- this should be smarter */ static gboolean is_email_address (const unsigned char *c) { gboolean seen_at = FALSE, seen_postat = FALSE; + if (c == NULL) + return FALSE; + if (*c == '<') ++c; @@ -100,6 +103,9 @@ email_address_extract (const unsigned char **text) const unsigned char *end = *text; char *out; + if (end == NULL) + return NULL; + while (*end && !isspace (*end) && (*end != '>') && (*end < 0x80)) ++end; @@ -293,12 +299,8 @@ e_text_to_html_full (const char *input, unsigned int flags, guint32 color) dispaddr = e_text_to_html (addr, 0); if (addr) { - gchar *outaddr = g_strdup_printf ("<a href=\"mailto:%s\">" - "<!--+GtkHTML:<DATA class=\"Text\" key=\"email\" value=\"%s\">-->" - "%s" - "<!--+GtkHTML:<DATA class=\"Text\" clear=\"email\">--> " - "</a>", - addr, addr, dispaddr); + gchar *outaddr = g_strdup_printf ("<a href=\"mailto:%s\">%s</a>", + addr, dispaddr); out = check_size (&buffer, &buffer_size, out, strlen(outaddr)); out += sprintf (out, "%s", outaddr); col += strlen (addr); |