aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Popela <tpopela@redhat.com>2014-08-01 20:49:57 +0800
committerTomas Popela <tpopela@redhat.com>2014-08-01 20:49:57 +0800
commitba8b45931956123e1621a669aee661e21c3287c0 (patch)
treec03ba13b9a875d170c7a492b8f5eeff34d2ee576
parent1a515c48f9808a7c73233b22a6708d4c6695af3b (diff)
downloadgsoc2013-evolution-ba8b45931956123e1621a669aee661e21c3287c0.tar
gsoc2013-evolution-ba8b45931956123e1621a669aee661e21c3287c0.tar.gz
gsoc2013-evolution-ba8b45931956123e1621a669aee661e21c3287c0.tar.bz2
gsoc2013-evolution-ba8b45931956123e1621a669aee661e21c3287c0.tar.lz
gsoc2013-evolution-ba8b45931956123e1621a669aee661e21c3287c0.tar.xz
gsoc2013-evolution-ba8b45931956123e1621a669aee661e21c3287c0.tar.zst
gsoc2013-evolution-ba8b45931956123e1621a669aee661e21c3287c0.zip
Bug 733973 - Calling e_html_editor_view_get_text_html() changes editors content
Do all the changes (remove the ids, classes, ... used internally by composer) on the BODY clone instead of doing them on real BODY.
-rw-r--r--e-util/e-html-editor-view.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c
index 34d59ad483..580c8a3e69 100644
--- a/e-util/e-html-editor-view.c
+++ b/e-util/e-html-editor-view.c
@@ -6441,15 +6441,17 @@ static gchar *
process_content_for_html (EHTMLEditorView *view)
{
WebKitDOMDocument *document;
- WebKitDOMNode *body;
- WebKitDOMElement *element;
+ WebKitDOMNode *body, *document_clone;
document = webkit_web_view_get_dom_document (WEBKIT_WEB_VIEW (view));
- body = WEBKIT_DOM_NODE (webkit_dom_document_get_body (document));
+ document_clone = webkit_dom_node_clone_node (
+ WEBKIT_DOM_NODE (webkit_dom_document_get_document_element (document)), TRUE);
+ body = WEBKIT_DOM_NODE (webkit_dom_element_query_selector (
+ WEBKIT_DOM_ELEMENT (document_clone), "body", NULL));
process_elements (view, body, TRUE, FALSE, FALSE, NULL);
- element = webkit_dom_document_get_document_element (document);
+
return webkit_dom_html_element_get_outer_html (
- WEBKIT_DOM_HTML_ELEMENT (element));
+ WEBKIT_DOM_HTML_ELEMENT (document_clone));
}
static gboolean