[evolution] Composer: Some parts of HTML not always converted into Plain Text



commit 3f530ba014518b7721ee4aed6bedd9cd40dca0e2
Author: Milan Crha <mcrha redhat com>
Date:   Mon Jul 11 17:44:08 2022 +0200

    Composer: Some parts of HTML not always converted into Plain Text
    
    When traversing the HTML structure the to-be-removed nodes in the middle
    of the text could prevent correct move between nodes, by traversing into
    them and immediately removing the node.

 data/webkit/e-editor.js | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/data/webkit/e-editor.js b/data/webkit/e-editor.js
index 48b3c7565c..bff3f1a8ae 100644
--- a/data/webkit/e-editor.js
+++ b/data/webkit/e-editor.js
@@ -2311,6 +2311,9 @@ EvoEditor.convertTags = function()
 
                /* Keep the signature SPAN there, it's required */
                if (node.nodeType == node.ELEMENT_NODE && (node.tagName != "SPAN" || node.className != 
"-x-evo-signature")) {
+                       node.removeAttribute("class");
+                       node.removeAttribute("style");
+
                        if (node.tagName != "DIV" &&
                            node.tagName != "PRE" &&
                            node.tagName != "BLOCKQUOTE" &&
@@ -2334,6 +2337,7 @@ EvoEditor.convertTags = function()
                                           node.tagName != "STYLE" &&
                                           node.tagName != "SCRIPT" &&
                                           node.tagName != "TEMPLATE" &&
+                                          node.tagName != "TITLE" &&
                                           node.tagName != "VAR" &&
                                           node.tagName != "VIDEO") {
                                        next = EvoEditor.moveNodeContent(node);
@@ -2341,6 +2345,10 @@ EvoEditor.convertTags = function()
                        }
                }
 
+               /* Do not traverse into the to-be-removed node */
+               if (!next && removeNode)
+                       next = node.nextSibling;
+
                if (!next)
                        next = EvoEditor.getNextNodeInHierarchy(node, document.body);
 


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