From 14446c79e895c3757dd20d675cd0cbb70d8eadda Mon Sep 17 00:00:00 2001 From: Tomas Popela Date: Wed, 30 Jul 2014 12:53:33 +0200 Subject: Bug 733953 - Citation marks incorrectly transformed on send Insert the new line characters on empty lines in quoted content. Also insert the NL when the BR element that is used for wrapping is processed. --- e-util/e-html-editor-view.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'e-util') diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c index 940f38eadb..132d6cbf6b 100644 --- a/e-util/e-html-editor-view.c +++ b/e-util/e-html-editor-view.c @@ -5746,11 +5746,26 @@ process_elements (EHTMLEditorView *view, if (WEBKIT_DOM_IS_HTMLBR_ELEMENT (child)) { if (to_plain_text) { + if (element_has_class (WEBKIT_DOM_ELEMENT (child), "-x-evo-wrap-br")) { + g_string_append (buffer, changing_mode ? "
" : "\n"); + goto next; + } + /* Insert new line when we hit the BR element that is * not the last element in the block */ if (!webkit_dom_node_is_same_node ( child, webkit_dom_node_get_last_child (node))) { g_string_append (buffer, changing_mode ? "
" : "\n"); + } else { + /* In citations in the empty lines the BR element + * is on the end and we have to put NL there */ + WebKitDOMNode *parent; + + parent = webkit_dom_node_get_parent_node (child); + parent = webkit_dom_node_get_parent_node (parent); + + if (is_citation_node (parent)) + g_string_append (buffer, changing_mode ? "
" : "\n"); } } } -- cgit v1.2.3