Commit 20c7ddae authored by Tomas Popela's avatar Tomas Popela

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.
parent 7b97ca12
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment