[evolution/wip/webkit2] EHTMLEditorView - Don't try to quote the content when creating the plain text version of HTML mail



commit 1e1ce13a79092a08e9e74908c53ae7fb6874b965
Author: Tomas Popela <tpopela redhat com>
Date:   Wed May 13 09:16:28 2015 +0200

    EHTMLEditorView - Don't try to quote the content when creating the plain text version of HTML mail
    
    Do it just when citation element is presented. Also fix one runtime warning
    when we were trying to cast WebKitDOMText on WebKitDOMElement.

 web-extensions/e-html-editor-view-dom-functions.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/web-extensions/e-html-editor-view-dom-functions.c 
b/web-extensions/e-html-editor-view-dom-functions.c
index da1f371..f50dba2 100644
--- a/web-extensions/e-html-editor-view-dom-functions.c
+++ b/web-extensions/e-html-editor-view-dom-functions.c
@@ -3377,7 +3377,7 @@ quote_plain_text_recursive (WebKitDOMDocument *document,
                }
 
                if (WEBKIT_DOM_IS_HTML_BR_ELEMENT (node) &&
-                   !next_sibling &&
+                   !next_sibling && WEBKIT_DOM_IS_ELEMENT (prev_sibling) &&
                    element_is_selection_marker (WEBKIT_DOM_ELEMENT (prev_sibling))) {
                        insert_quote_symbols_before_node (
                                document, node, quote_level, FALSE);
@@ -6352,8 +6352,16 @@ dom_process_content_for_plain_text (WebKitDOMDocument *document,
        }
        g_object_unref (paragraphs);
 
-       if (e_html_editor_web_extension_get_html_mode (extension) || quote)
+       if (quote)
                quote_plain_text_recursive (document, source, source, 0);
+       else if (e_html_editor_web_extension_get_html_mode (extension)) {
+               WebKitDOMElement *citation;
+
+               citation = webkit_dom_element_query_selector (
+                       WEBKIT_DOM_ELEMENT (source), "blockquote[type=cite]", NULL);
+               if (citation)
+                       quote_plain_text_recursive (document, source, source, 0);
+       }
 
        process_elements (extension, source, FALSE, FALSE, TRUE, plain_text);
 


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