[evolution] I#1679 - e-convert.js: Do not re-wrap gmail_quote paragraphs



commit 8e2853140b5bd2ca50808ffc0dfd90aa9ea47576
Author: Milan Crha <mcrha redhat com>
Date:   Mon Nov 8 14:36:06 2021 +0100

    I#1679 - e-convert.js: Do not re-wrap gmail_quote paragraphs
    
    Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1679

 data/webkit/e-convert.js | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)
---
diff --git a/data/webkit/e-convert.js b/data/webkit/e-convert.js
index a2cb7e10ac..580e5ccb93 100644
--- a/data/webkit/e-convert.js
+++ b/data/webkit/e-convert.js
@@ -912,7 +912,25 @@ EvoConvert.processNode = function(node, normalDivWidth, quoteLevel)
                                useDefaultWidth = true;
                        }
 
-                       if (useDefaultWidth && normalDivWidth > 0) {
+                       var childrenWillWrap = true;
+                       if (!node.classList.contains("gmail_quote")) {
+                               var ii;
+                               for (ii = 0; childrenWillWrap && ii < node.childNodes.length; ii++) {
+                                       var child = node.childNodes.item(ii);
+                                       childrenWillWrap = (child.nodeType == child.ELEMENT_NODE &&
+                                                          (child.tagName == "DIV" ||
+                                                           child.tagName == "P" ||
+                                                           child.tagName == "PRE" ||
+                                                           child.tagName == "BLOCKQUOTE" ||
+                                                           child.tagName == "BR")) ||
+                                                          (child.nodeType == child.TEXT_NODE &&
+                                                           EvoConvert.RemoveInsignificantNewLines(child, 
true).trim().length == 0);
+                               }
+                       }
+
+                       if (childrenWillWrap) {
+                               width = -1;
+                       } else if (useDefaultWidth && normalDivWidth > 0) {
                                width = normalDivWidth - (quoteLevel * 2);
 
                                if (width < EvoConvert.MIN_PARAGRAPH_WIDTH)


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