From 33db93fc60717a23031b8c535712ff2ea96b6940 Mon Sep 17 00:00:00 2001 From: Tomas Popela Date: Wed, 29 Jun 2016 12:12:52 +0200 Subject: [PATCH] EHTMLEditorView - Don't add a new line for the empty list when generating a plain text version of the content --- e-util/e-html-editor-view.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c index 2599603e91..24e3917bc4 100644 --- a/e-util/e-html-editor-view.c +++ b/e-util/e-html-editor-view.c @@ -9260,6 +9260,7 @@ process_list_to_plain_text (EHTMLEditorView *view, EHTMLEditorSelectionBlockFormat format; EHTMLEditorSelectionAlignment alignment; gint counter = 1; + gboolean empty = TRUE; gchar *indent_per_level = g_strnfill (SPACES_PER_LIST_LEVEL, ' '); WebKitDOMNode *item; gint word_wrap_length = e_html_editor_selection_get_word_wrap_length ( @@ -9279,6 +9280,8 @@ process_list_to_plain_text (EHTMLEditorView *view, WebKitDOMElement *wrapped; GString *item_value = g_string_new (""); + empty = FALSE; + alignment = e_html_editor_selection_get_list_alignment_from_node ( WEBKIT_DOM_NODE (item)); @@ -9476,7 +9479,7 @@ process_list_to_plain_text (EHTMLEditorView *view, } } - if (webkit_dom_node_get_next_sibling (WEBKIT_DOM_NODE (element))) + if (webkit_dom_node_get_next_sibling (WEBKIT_DOM_NODE (element)) && !empty) g_string_append (output, "\n"); g_free (indent_per_level);