[evolution/gnome-3-18] EHTMLEditorView - Extra new line added after pressing the Backspace in a list item with one characte



commit a3e71dffae1e72d39f21506d8c6b71bd28a2ad36
Author: Tomas Popela <tpopela redhat com>
Date:   Fri Jan 15 14:03:46 2016 +0100

    EHTMLEditorView - Extra new line added after pressing the Backspace in a list item with one character
    
    When the Backspace is pressed in a bulleted list item with just one character
    left in it, WebKit will create another BR element in the item.

 e-util/e-html-editor-view.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c
index a823b4c..2907ed0 100644
--- a/e-util/e-html-editor-view.c
+++ b/e-util/e-html-editor-view.c
@@ -2807,6 +2807,19 @@ body_input_event_cb (WebKitDOMElement *element,
                goto out;
        }
 
+       /* When the Backspace is pressed in a bulleted list item with just one
+        * character left in it, WebKit will create another BR element in the
+        * item. */
+       if (!view->priv->html_mode) {
+               WebKitDOMElement *element;
+
+               element = webkit_dom_document_query_selector (
+                       document, "ul[data-evo-plain-text] > li > br + br", NULL);
+
+               if (element)
+                       remove_node (WEBKIT_DOM_NODE (element));
+       }
+
        if (!save_history_after_event_in_table (view)) {
                if (!view->priv->dont_save_history_in_body_input)
                        save_history_for_input (view);


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