diff options
Diffstat (limited to 'e-util/e-html-editor-view.c')
-rw-r--r-- | e-util/e-html-editor-view.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c index 0432a01426..5956439f1e 100644 --- a/e-util/e-html-editor-view.c +++ b/e-util/e-html-editor-view.c @@ -3430,6 +3430,7 @@ create_anchor_for_link (const GMatchInfo *info, GString *res, gpointer data) { + gint offset = 0; gchar *match; gboolean address_surrounded; @@ -3441,27 +3442,29 @@ create_anchor_for_link (const GMatchInfo *info, g_str_has_suffix (match, ">"); if (address_surrounded) + offset += 4; + + if (g_str_has_prefix (match, " ")) + offset += 6; + + if (address_surrounded) g_string_append (res, "<"); g_string_append (res, "<a href=\""); if (strstr (match, "@")) { g_string_append (res, "mailto:"); - if (address_surrounded) { - g_string_append (res, match + 4); + g_string_append (res, match + offset); + if (address_surrounded) g_string_truncate (res, res->len - 4); - } else - g_string_append (res, match); g_string_append (res, "\">"); - if (address_surrounded) { - g_string_append (res, match + 4); + g_string_append (res, match + offset); + if (address_surrounded) g_string_truncate (res, res->len - 4); - } else - g_string_append (res, match); } else { - g_string_append (res, match); + g_string_append (res, match + offset); g_string_append (res, "\">"); - g_string_append (res, match); + g_string_append (res, match + offset); } g_string_append (res, "</a>"); |