diff --git a/js/mzta-compose-script.js b/js/mzta-compose-script.js index 05fc96a6..cf0e4a94 100644 --- a/js/mzta-compose-script.js +++ b/js/mzta-compose-script.js @@ -79,7 +79,10 @@ switch (message.command) { for (const node of children) { if (node instanceof Element) { - if (node.classList.contains('moz-cite-prefix')) { + if (node.classList.contains('moz-cite-prefix')) { // quoted text in a reply + break; + } + if (node.classList.contains('moz-forward-container')) { // quoted text in a forward break; } } @@ -121,7 +124,7 @@ switch (message.command) { for (const node of children) { if (!foundCitePrefix) { - if (node instanceof Element && node.classList.contains('moz-cite-prefix')) { + if (node instanceof Element && (node.classList.contains('moz-cite-prefix') || node.classList.contains('moz-forward-container'))) { foundCitePrefix = true; } else { continue; diff --git a/js/mzta-utils.js b/js/mzta-utils.js index 3a9b0af6..8c072966 100644 --- a/js/mzta-utils.js +++ b/js/mzta-utils.js @@ -485,8 +485,11 @@ const insertHtml = function (replyHtml, fullBody_string) { let fullBody = parser.parseFromString(fullBody_string, "text/html"); let reply = parser.parseFromString(replyHtml, "text/html"); - // looking for the first quoted mail or the signature, which come first in case of "signature above the quote". - const prefix_quote = fullBody.getElementsByClassName("moz-cite-prefix"); + // looking for the first quoted mail (reply or forward) or the signature, which come first in case of "signature above the quote". + let prefix_quote = fullBody.getElementsByClassName("moz-cite-prefix"); + if(prefix_quote.length == 0){ + prefix_quote = fullBody.getElementsByClassName("moz-forward-container"); + } const prefix_sign = fullBody.getElementsByClassName("moz-signature"); let firstElement = null;