aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Popela <tpopela@redhat.com>2014-06-25 16:27:41 +0800
committerTomas Popela <tpopela@redhat.com>2014-06-25 21:59:50 +0800
commitbfde2f572e5b461e34f607fbdc6e018c34b5cdf8 (patch)
tree18e99c6bc4b78a58088c0a031d94703fdc70ac93
parent6765ed10ff637c382031504b6dee647babea2375 (diff)
downloadgsoc2013-evolution-bfde2f572e5b461e34f607fbdc6e018c34b5cdf8.tar
gsoc2013-evolution-bfde2f572e5b461e34f607fbdc6e018c34b5cdf8.tar.gz
gsoc2013-evolution-bfde2f572e5b461e34f607fbdc6e018c34b5cdf8.tar.bz2
gsoc2013-evolution-bfde2f572e5b461e34f607fbdc6e018c34b5cdf8.tar.lz
gsoc2013-evolution-bfde2f572e5b461e34f607fbdc6e018c34b5cdf8.tar.xz
gsoc2013-evolution-bfde2f572e5b461e34f607fbdc6e018c34b5cdf8.tar.zst
gsoc2013-evolution-bfde2f572e5b461e34f607fbdc6e018c34b5cdf8.zip
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.
-rw-r--r--e-util/e-html-editor-view.c10
1 files 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),
- "&nbsp;",
+ "<br>",
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 : "<br>",
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 : "<br>",
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 */