[evolution/wip/webkit-composer] EEditorWidget: Surround with paragraph only if writing straight into BODY



commit 35d0e2459394efc8e3f9fd5b11ac660538b86dc7
Author: Tomas Popela <tpopela redhat com>
Date:   Tue Jan 28 14:42:32 2014 +0100

    EEditorWidget: Surround with paragraph only if writing straight into BODY

 e-util/e-editor-widget.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/e-util/e-editor-widget.c b/e-util/e-editor-widget.c
index 417a9cd..272b20e 100644
--- a/e-util/e-editor-widget.c
+++ b/e-util/e-editor-widget.c
@@ -1175,7 +1175,9 @@ editor_widget_key_release_event (GtkWidget *widget,
                /* All text in composer has to be written in div elements, so if
                 * we are writing something straight to the body, surround it with
                 * paragraph */
-               if (WEBKIT_DOM_IS_HTMLBR_ELEMENT (next_sibling) && WEBKIT_DOM_IS_TEXT (node)) {
+               if (WEBKIT_DOM_IS_HTMLBR_ELEMENT (next_sibling) && WEBKIT_DOM_IS_TEXT (node) &&
+                   WEBKIT_DOM_IS_HTML_BODY_ELEMENT (webkit_dom_node_get_parent_node (node))) {
+                       g_warning ("WRAPPING");
                        WebKitDOMDocument *document =
                                webkit_web_view_get_dom_document (WEBKIT_WEB_VIEW (widget));
                        EEditorSelection *selection =


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