From 9954e25b65366cc7c5a2002d9fe2bc2cca736cbc Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Mon, 3 Jun 2024 16:01:52 +0200 Subject: [PATCH] Resolve #1609 --- dev/View/Popup/Compose.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/dev/View/Popup/Compose.js b/dev/View/Popup/Compose.js index b8f953ccd..e937a772b 100644 --- a/dev/View/Popup/Compose.js +++ b/dev/View/Popup/Compose.js @@ -890,7 +890,7 @@ export class ComposePopupView extends AbstractViewPopup { } if (options.mode && oLastMessage) { - let encrypted, + let usePlain, sCc = '', sDate = timestampToString(oLastMessage.dateTimestamp(), 'FULL'), sSubject = oLastMessage.subject(), @@ -998,18 +998,14 @@ export class ComposePopupView extends AbstractViewPopup { break; default: - encrypted = PgpUserStore.isEncrypted(sText); - if (encrypted) { + usePlain = PgpUserStore.isEncrypted(sText) || isPlainEditor() || !oLastMessage.isHtml(); + if (usePlain) { sText = oLastMessage.plain(); } } this.editor(editor => { - encrypted || editor.setHtml(sText); - if (encrypted || isPlainEditor()) { - editor.modePlain(); - } - encrypted && editor.setPlain(sText); + usePlain ? (editor.modePlain() | editor.setPlain(sText)) : editor.setHtml(sText); this.setSignature(identity, options.mode); this.setFocusInPopup(); }); @@ -1510,6 +1506,8 @@ export class ComposePopupView extends AbstractViewPopup { do { l = Text.length; Text = Text + // Remove line duplication + .replace(/
<\/div>/gi, '') // Remove Microsoft Office styling .replace(/(<[^>]+[;"'])\s*mso-[a-z-]+\s*:[^;"']+/gi, '$1') // Remove hubspot data-hs- attributes