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



commit f29224c0e31eade2716e6e6ce2b35dd684ab6f71
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]