diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c
index 3651a397f0..0da22eb08d 100644
--- a/e-util/e-html-editor-view.c
+++ b/e-util/e-html-editor-view.c
@@ -1050,17 +1050,21 @@ move_elements_to_body (WebKitDOMDocument *document)
list = webkit_dom_document_query_selector_all (
document, "span.-x-evo-to-body[data-credits]", NULL);
for (ii = webkit_dom_node_list_get_length (list) - 1; ii >= 0; ii--) {
- WebKitDOMNode *child;
+ char *credits;
+ WebKitDOMElement *pre_element;
WebKitDOMNode *node = webkit_dom_node_list_item (list, ii);
- while ((child = webkit_dom_node_get_first_child (node))) {
- webkit_dom_node_insert_before (
- WEBKIT_DOM_NODE (body),
- child,
- webkit_dom_node_get_first_child (
- WEBKIT_DOM_NODE (body)),
- NULL);
- }
+ pre_element = webkit_dom_document_create_element (document, "pre", NULL);
+ credits = webkit_dom_element_get_attribute (WEBKIT_DOM_ELEMENT (node), "data-credits");
+ webkit_dom_html_element_set_inner_text (WEBKIT_DOM_HTML_ELEMENT (pre_element), credits, NULL);
+ g_free (credits);
+
+ webkit_dom_node_insert_before (
+ WEBKIT_DOM_NODE (body),
+ WEBKIT_DOM_NODE (pre_element),
+ webkit_dom_node_get_first_child (
+ WEBKIT_DOM_NODE (body)),
+ NULL);
remove_node (node);
}
@@ -4904,16 +4908,20 @@ html_editor_convert_view_content (EHTMLEditorView *view,
document, "span.-x-evo-to-body[data-credits]", NULL);
length = webkit_dom_node_list_get_length (list);
for (ii = 0; ii < length; ii++) {
- WebKitDOMNode *node, *child;
+ char *credits;
+ WebKitDOMElement *pre_element;
+ WebKitDOMNode *node = webkit_dom_node_list_item (list, ii);
- node = webkit_dom_node_list_item (list, ii);
- while ((child = webkit_dom_node_get_first_child (node))) {
- webkit_dom_node_insert_before (
- WEBKIT_DOM_NODE (wrapper),
- child,
- WEBKIT_DOM_NODE (content_wrapper),
- NULL);
- }
+ pre_element = webkit_dom_document_create_element (document, "pre", NULL);
+ credits = webkit_dom_element_get_attribute (WEBKIT_DOM_ELEMENT (node), "data-credits");
+ webkit_dom_html_element_set_inner_text (WEBKIT_DOM_HTML_ELEMENT (pre_element), credits, NULL);
+ g_free (credits);
+
+ webkit_dom_node_insert_before (
+ WEBKIT_DOM_NODE (wrapper),
+ WEBKIT_DOM_NODE (pre_element),
+ WEBKIT_DOM_NODE (content_wrapper),
+ NULL);
remove_node (node);
}
diff --git a/em-format/e-mail-formatter-quote.c b/em-format/e-mail-formatter-quote.c
index bbd2da45a9..1916bbad8f 100644
--- a/em-format/e-mail-formatter-quote.c
+++ b/em-format/e-mail-formatter-quote.c
@@ -122,7 +122,7 @@ mail_formatter_quote_run (EMailFormatter *formatter,
* the special span element and it will be moved to body in EHTMLEditorView */
if (qf->priv->credits && *qf->priv->credits) {
gchar *credits = g_strdup_printf (
- "%s
",
+ "",
qf->priv->credits);
g_output_stream_write_all (
stream, credits, strlen (credits), NULL, cancellable, NULL);