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



commit 9bd74a1d67fe9522ae5409ad63a39b66bc0c59e4
Author: Tomas Popela <tpopela redhat com>
Date:   Thu Mar 26 08:08:59 2015 +0100

    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.

 e-util/e-html-editor-view.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c
index 99bef84..ab0e970 100644
--- a/e-util/e-html-editor-view.c
+++ b/e-util/e-html-editor-view.c
@@ -5483,7 +5483,7 @@ quote_plain_text_recursive (WebKitDOMDocument *document,
                }
 
                if (WEBKIT_DOM_IS_HTMLBR_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);
@@ -8711,8 +8711,16 @@ process_content_for_plain_text (EHTMLEditorView *view)
        }
        g_object_unref (paragraphs);
 
-       if (view->priv->html_mode || quote)
+       if (quote) {
                quote_plain_text_recursive (document, source, source, 0);
+       } else if (view->priv->html_mode) {
+               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 (view, source, FALSE, FALSE, TRUE, plain_text);
 


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