From fa55238d1ebf5e454d66858e7a523e8acc91ee65 Mon Sep 17 00:00:00 2001 From: Tomas Popela Date: Fri, 5 Sep 2014 13:37:59 +0200 Subject: EHTMLEditorView - Avoid extra new line when quoting the text Don't insert the unnecessary BR element before the BR element that is used for wrapping as it will end in unnecessary new line. --- e-util/e-html-editor-view.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c index 892b570deb..acd52806bc 100644 --- a/e-util/e-html-editor-view.c +++ b/e-util/e-html-editor-view.c @@ -3210,6 +3210,7 @@ insert_quote_symbols_before_node (WebKitDOMDocument *document, gint quote_level, gboolean is_html_node) { + gboolean skip; gchar *quotation; WebKitDOMElement *element; @@ -3219,7 +3220,11 @@ insert_quote_symbols_before_node (WebKitDOMDocument *document, webkit_dom_html_element_set_inner_html ( WEBKIT_DOM_HTML_ELEMENT (element), quotation, NULL); - if (is_html_node) { + /* Don't insert temporary BR before BR that is used for wrapping */ + skip = WEBKIT_DOM_IS_HTMLBR_ELEMENT (node); + skip = skip && element_has_class (WEBKIT_DOM_ELEMENT (node), "-x-evo-wrap-br"); + + if (is_html_node && !skip) { WebKitDOMElement *new_br; new_br = webkit_dom_document_create_element (document, "br", NULL); -- cgit v1.2.3