[geary/wip/712912-select-quote: 7/7] Strip quote chrome from selection when replying



commit 7f2034f0876b63658fd1acbf02055dd561e98fe7
Author: Robert Schroll <rschroll gmail com>
Date:   Fri Sep 19 02:15:15 2014 -0400

    Strip quote chrome from selection when replying
    
    https://bugzilla.gnome.org/show_bug.cgi?id=712912

 .../conversation-viewer/conversation-viewer.vala   |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/client/conversation-viewer/conversation-viewer.vala 
b/src/client/conversation-viewer/conversation-viewer.vala
index a7103a8..0148335 100644
--- a/src/client/conversation-viewer/conversation-viewer.vala
+++ b/src/client/conversation-viewer/conversation-viewer.vala
@@ -249,6 +249,15 @@ public class ConversationViewer : Gtk.Box {
                     include_dummy = true;
                 }
                 dummy.append_child(range.clone_contents());
+                
+                // Remove the chrome we put around quotes, leaving only the blockquote element.
+                WebKit.DOM.NodeList quotes = dummy.query_selector_all(".quote_container");
+                for (int i = 0; i < quotes.length; i++) {
+                    WebKit.DOM.Element div = (WebKit.DOM.Element) quotes.item(i);
+                    WebKit.DOM.Element blockquote = div.query_selector("blockquote");
+                    div.get_parent_element().replace_child(blockquote, div);
+                }
+                
                 quote = include_dummy ? dummy.get_outer_html() : dummy.get_inner_html();
                 return anchor_email;
             } catch (Error error) {


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