diff options
author | Tomas Popela <tpopela@redhat.com> | 2014-07-21 22:59:10 +0800 |
---|---|---|
committer | Tomas Popela <tpopela@redhat.com> | 2014-07-21 23:02:08 +0800 |
commit | 85ceca17e61b29385a4332e1547f5f8861bdf502 (patch) | |
tree | 541deb4dc28e841e2e526cb32e28fcebfcef7eb9 /e-util | |
parent | 5a0dd1368efc607cea7c0190da7739f319c64a14 (diff) | |
download | gsoc2013-evolution-85ceca17e61b29385a4332e1547f5f8861bdf502.tar gsoc2013-evolution-85ceca17e61b29385a4332e1547f5f8861bdf502.tar.gz gsoc2013-evolution-85ceca17e61b29385a4332e1547f5f8861bdf502.tar.bz2 gsoc2013-evolution-85ceca17e61b29385a4332e1547f5f8861bdf502.tar.lz gsoc2013-evolution-85ceca17e61b29385a4332e1547f5f8861bdf502.tar.xz gsoc2013-evolution-85ceca17e61b29385a4332e1547f5f8861bdf502.tar.zst gsoc2013-evolution-85ceca17e61b29385a4332e1547f5f8861bdf502.zip |
EHTMLEditorView - When the link has non-breaking space in the prefix skip it
Diffstat (limited to 'e-util')
-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>"); |