[evolution] e-editor.js: Normalize blockquote-s for replies/forwards



commit dded38ef58bfdb0526cc8c948cef308a009714b3
Author: Milan Crha <mcrha redhat com>
Date:   Tue Apr 28 17:24:39 2020 +0200

    e-editor.js: Normalize blockquote-s for replies/forwards
    
    Noticed on a Gmail generated quotation, which broke the editor/convert code.

 data/webkit/e-editor.js | 13 +++++++++++++
 1 file changed, 13 insertions(+)
---
diff --git a/data/webkit/e-editor.js b/data/webkit/e-editor.js
index 924b1e6914..1626c43895 100644
--- a/data/webkit/e-editor.js
+++ b/data/webkit/e-editor.js
@@ -5491,8 +5491,21 @@ EvoEditor.processLoadedContent = function()
                        }
                }
 
+               if (blockquoteNode.className == "gmail_quote") {
+                       if (blockquoteNode.lastChild && blockquoteNode.lastChild.tagName != "BR" && 
blockquoteNode.nextSibling) {
+                               blockquoteNode.appendChild(document.createElement("BR"));
+                       }
+               }
+
+               if (blockquoteNode.previousSibling &&
+                   blockquoteNode.previousSibling.nodeType == blockquoteNode.TEXT_NODE &&
+                   blockquoteNode.previousSibling.nodeValue) {
+                       blockquoteNode.parentElement.insertBefore(document.createElement("BR"), 
blockquoteNode);
+               }
+
                blockquoteNode.removeAttribute("class");
                blockquoteNode.removeAttribute("style");
+               blockquoteNode.setAttribute("type", "cite");
        }
 
        if (EvoEditor.mode == EvoEditor.MODE_PLAIN_TEXT) {


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