From bfde2f572e5b461e34f607fbdc6e018c34b5cdf8 Mon Sep 17 00:00:00 2001 From: Tomas Popela Date: Wed, 25 Jun 2014 10:27:41 +0200 Subject: EHTMLEditorView - Preserve empty lines when processing the text in convertor Also insert the BR elements instead of the non-breaking space as a content to empty paragraphs to avoid unwanted character there. --- e-util/e-html-editor-view.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c index b44b877356..2bdd06464b 100644 --- a/e-util/e-html-editor-view.c +++ b/e-util/e-html-editor-view.c @@ -2766,7 +2766,7 @@ parse_html_into_paragraphs (EHTMLEditorView *view, webkit_dom_html_element_set_inner_html ( WEBKIT_DOM_HTML_ELEMENT (paragraph_clone), - " ", + "
", NULL); webkit_dom_node_append_child ( @@ -2824,7 +2824,7 @@ parse_html_into_paragraphs (EHTMLEditorView *view, webkit_dom_html_element_set_inner_html ( WEBKIT_DOM_HTML_ELEMENT (paragraph), - rest_to_insert, + *rest_to_insert ? rest_to_insert : "
", NULL); webkit_dom_node_append_child ( @@ -2880,7 +2880,7 @@ parse_html_into_paragraphs (EHTMLEditorView *view, webkit_dom_html_element_set_inner_html ( WEBKIT_DOM_HTML_ELEMENT (paragraph), - rest_to_insert, + *rest_to_insert ? rest_to_insert : "
", NULL); webkit_dom_node_append_child ( @@ -5045,6 +5045,10 @@ process_elements (EHTMLEditorView *view, gboolean add_br = TRUE; WebKitDOMNode *next_sibling = webkit_dom_node_get_next_sibling (node); + WebKitDOMNode *last_child = webkit_dom_node_get_last_child (node); + + if (last_child && WEBKIT_DOM_IS_HTMLBR_ELEMENT (last_child)) + add_br = FALSE; /* If we don't have next sibling (last element in body) or next element is * signature we are not adding the BR element */ -- cgit v1.2.3