[evolution] Bug 733953 - Citation marks incorrectly transformed on send



commit 14446c79e895c3757dd20d675cd0cbb70d8eadda
Author: Tomas Popela <tpopela redhat com>
Date:   Wed Jul 30 12:53:33 2014 +0200

    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 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c
index 940f38e..132d6cb 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 ? "<br>" : "\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 ? "<br>" : "\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 ? "<br>" : "\n");
                                }
                        }
                }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]