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



commit be83e3ac7438a96bf08ec6b86071fd5c2ce7cb3d
Author: Tomas Popela <tpopela redhat com>
Date:   Thu Mar 3 13:54:11 2016 +0100

    EHTMLEditorView - Extra new line added after pressing the Backspace in a list item with one character

 .../composer/e-html-editor-view-dom-functions.c    |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/web-extensions/composer/e-html-editor-view-dom-functions.c 
b/web-extensions/composer/e-html-editor-view-dom-functions.c
index d3341c8..61117f9 100644
--- a/web-extensions/composer/e-html-editor-view-dom-functions.c
+++ b/web-extensions/composer/e-html-editor-view-dom-functions.c
@@ -2328,6 +2328,19 @@ body_input_event_process (WebKitDOMDocument *document,
                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 (!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 (document, extension)) {
                if (!e_html_editor_web_extension_get_dont_save_history_in_body_input (extension))
                        save_history_for_input (document, extension);


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