[evolution] EHTMLEditorView - Extra new line added after pressing the	Backspace in a list item with one characte
- From: Tomas Popela <tpopela src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [evolution] EHTMLEditorView - Extra new line added after pressing the	Backspace in a list item with one characte
- Date: Fri, 15 Jan 2016 13:38:59 +0000 (UTC)
commit 9e263c6e4771a7a4bfd7897cb995e2c4773e3a1a
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 2077f1d..be08f6c 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]