diff options
author | Tomas Popela <tpopela@redhat.com> | 2014-06-30 20:26:21 +0800 |
---|---|---|
committer | Tomas Popela <tpopela@redhat.com> | 2014-06-30 20:36:24 +0800 |
commit | 51a5e90fd9b3961f07997909369b12ef5979ad5c (patch) | |
tree | 3bd29be6db148af5d3dd8c5c47d36d86475897a8 | |
parent | 42da9384e4f3792917ffc5aca64ec71f2ef07922 (diff) | |
download | gsoc2013-evolution-51a5e90fd9b3961f07997909369b12ef5979ad5c.tar gsoc2013-evolution-51a5e90fd9b3961f07997909369b12ef5979ad5c.tar.gz gsoc2013-evolution-51a5e90fd9b3961f07997909369b12ef5979ad5c.tar.bz2 gsoc2013-evolution-51a5e90fd9b3961f07997909369b12ef5979ad5c.tar.lz gsoc2013-evolution-51a5e90fd9b3961f07997909369b12ef5979ad5c.tar.xz gsoc2013-evolution-51a5e90fd9b3961f07997909369b12ef5979ad5c.tar.zst gsoc2013-evolution-51a5e90fd9b3961f07997909369b12ef5979ad5c.zip |
EHTMLEditorSelection - Fix wrapping of the anchor elements
When there is a whitespace after the link leave it after the link and don't
try to wrap before it.
-rw-r--r-- | e-util/e-html-editor-selection.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/e-util/e-html-editor-selection.c b/e-util/e-html-editor-selection.c index 938a06dc87..87138dc075 100644 --- a/e-util/e-html-editor-selection.c +++ b/e-util/e-html-editor-selection.c @@ -4676,7 +4676,7 @@ find_where_to_break_line (WebKitDOMNode *node, if ((pos > max_len) && (last_space > 0)) { if (last_space > word_wrap_length) { g_free (text_start); - return last_space; + return last_space - 1; } if (last_space > max_len) { @@ -4883,7 +4883,17 @@ wrap_lines (EHTMLEditorSelection *selection, len += anchor_length; g_free (text_content); + /* If there is space after the anchor don't try to + * wrap before it */ node = webkit_dom_node_get_next_sibling (node); + if (WEBKIT_DOM_IS_TEXT (node)) { + text_content = webkit_dom_node_get_text_content (node); + if (g_strcmp0 (text_content, " ") == 0) { + node = webkit_dom_node_get_next_sibling (node); + len++; + } + g_free (text_content); + } continue; } |