[evolution/gnome-3-18] EHTMLEditorView - Quote symbols could be inserted twice around tabulator



commit 21712b8f8108eab28ff2f27f1056253e57e4a9ef
Author: Tomas Popela <tpopela redhat com>
Date:   Tue Oct 20 15:07:53 2015 +0200

    EHTMLEditorView - Quote symbols could be inserted twice around tabulator
    
    When the block begins with tabulator followed by text then the quote characters
    are inserted to the beginning of the block (that's right) as well as after the
    tabulator before the text (that's wrong).

 e-util/e-html-editor-view.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c
index 799f7de..8854a2e 100644
--- a/e-util/e-html-editor-view.c
+++ b/e-util/e-html-editor-view.c
@@ -6164,7 +6164,8 @@ quote_node (WebKitDOMDocument *document,
                WEBKIT_DOM_IS_HTML_ANCHOR_ELEMENT (prev_sibling) ||
                element_has_tag (WEBKIT_DOM_ELEMENT (prev_sibling), "b") ||
                element_has_tag (WEBKIT_DOM_ELEMENT (prev_sibling), "i") ||
-               element_has_tag (WEBKIT_DOM_ELEMENT (prev_sibling), "u"));
+               element_has_tag (WEBKIT_DOM_ELEMENT (prev_sibling), "u") ||
+               element_has_class (WEBKIT_DOM_ELEMENT (prev_sibling), "Apple-tab-span"));
 
        if (prev_sibling && is_html_node)
                skip_first = TRUE;
@@ -6356,7 +6357,8 @@ quote_plain_text_recursive (WebKitDOMDocument *document,
                        WEBKIT_DOM_IS_HTML_ANCHOR_ELEMENT (node) ||
                        element_has_tag (WEBKIT_DOM_ELEMENT (node), "b") ||
                        element_has_tag (WEBKIT_DOM_ELEMENT (node), "i") ||
-                       element_has_tag (WEBKIT_DOM_ELEMENT (node), "u");
+                       element_has_tag (WEBKIT_DOM_ELEMENT (node), "u") ||
+                       element_has_class (WEBKIT_DOM_ELEMENT (node), "Apple-tab-span");
 
                if (is_html_node) {
                        gboolean wrap_br;
@@ -6367,9 +6369,12 @@ quote_plain_text_recursive (WebKitDOMDocument *document,
                                element_has_class (
                                        WEBKIT_DOM_ELEMENT (prev_sibling), "-x-evo-wrap-br");
 
-                       if (!prev_sibling || wrap_br)
+                       if (!prev_sibling || wrap_br) {
                                insert_quote_symbols_before_node (
                                        document, node, quote_level, FALSE);
+                               if (!prev_sibling && next_sibling && WEBKIT_DOM_IS_TEXT (next_sibling))
+                                       suppress_next = TRUE;
+                       }
 
                        if (WEBKIT_DOM_IS_HTMLBR_ELEMENT (prev_sibling) && !wrap_br)
                                insert_quote_symbols_before_node (


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