From 9b5c2022d7d8921084e0e29f966bd4d384cc5cea Mon Sep 17 00:00:00 2001 From: Tomas Popela Date: Tue, 1 Jul 2014 15:09:31 +0200 Subject: EHTMLEditorView - Create new paragraph in body if body is empty and save caret there --- e-util/e-html-editor-view.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c index 5ca0dc0204..8039a5ce52 100644 --- a/e-util/e-html-editor-view.c +++ b/e-util/e-html-editor-view.c @@ -3872,6 +3872,14 @@ html_editor_view_process_document_from_convertor (EHTMLEditorView *view, first_child = webkit_dom_node_get_first_child ( WEBKIT_DOM_NODE (body)); + if (!first_child) { + paragraph = e_html_editor_selection_get_paragraph_element ( + selection, document, -1, 0); + first_child = webkit_dom_node_append_child ( + WEBKIT_DOM_NODE (body), + WEBKIT_DOM_NODE (paragraph), + NULL); + } webkit_dom_node_insert_before ( first_child, -- cgit v1.2.3