aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Popela <tpopela@redhat.com>2014-07-30 18:53:33 +0800
committerTomas Popela <tpopela@redhat.com>2014-07-30 18:59:54 +0800
commit14446c79e895c3757dd20d675cd0cbb70d8eadda (patch)
tree74d344f55d3b7ac262cddfa2d498ff4bc225e0d7
parent91c1a679ba154516f8b52dee0cd8de0c6e2819c8 (diff)
downloadgsoc2013-evolution-14446c79e895c3757dd20d675cd0cbb70d8eadda.tar
gsoc2013-evolution-14446c79e895c3757dd20d675cd0cbb70d8eadda.tar.gz
gsoc2013-evolution-14446c79e895c3757dd20d675cd0cbb70d8eadda.tar.bz2
gsoc2013-evolution-14446c79e895c3757dd20d675cd0cbb70d8eadda.tar.lz
gsoc2013-evolution-14446c79e895c3757dd20d675cd0cbb70d8eadda.tar.xz
gsoc2013-evolution-14446c79e895c3757dd20d675cd0cbb70d8eadda.tar.zst
gsoc2013-evolution-14446c79e895c3757dd20d675cd0cbb70d8eadda.zip
Bug 733953 - Citation marks incorrectly transformed on send
Insert the new line characters on empty lines in quoted content. Also insert the NL when the BR element that is used for wrapping is processed.
-rw-r--r--e-util/e-html-editor-view.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c
index 940f38eadb..132d6cbf6b 100644
--- a/e-util/e-html-editor-view.c
+++ b/e-util/e-html-editor-view.c
@@ -5746,11 +5746,26 @@ process_elements (EHTMLEditorView *view,
if (WEBKIT_DOM_IS_HTMLBR_ELEMENT (child)) {
if (to_plain_text) {
+ if (element_has_class (WEBKIT_DOM_ELEMENT (child), "-x-evo-wrap-br")) {
+ g_string_append (buffer, changing_mode ? "<br>" : "\n");
+ goto next;
+ }
+
/* Insert new line when we hit the BR element that is
* not the last element in the block */
if (!webkit_dom_node_is_same_node (
child, webkit_dom_node_get_last_child (node))) {
g_string_append (buffer, changing_mode ? "<br>" : "\n");
+ } else {
+ /* In citations in the empty lines the BR element
+ * is on the end and we have to put NL there */
+ WebKitDOMNode *parent;
+
+ parent = webkit_dom_node_get_parent_node (child);
+ parent = webkit_dom_node_get_parent_node (parent);
+
+ if (is_citation_node (parent))
+ g_string_append (buffer, changing_mode ? "<br>" : "\n");
}
}
}