Improved Composer handling with PGP messages

This commit is contained in:
the-djmaze 2022-02-04 13:40:59 +01:00
parent 96de0be977
commit 3fc5216841
5 changed files with 103 additions and 125 deletions

View file

@ -616,23 +616,16 @@ export class MessageModel extends AbstractModel {
bodyAsHTML() {
// if (this.body && !this.body.querySelector('iframe[src*=decrypt]')) {
if (this.body && !this.body.querySelector('iframe')) {
let clone = this.body.cloneNode(true),
attr = 'data-html-editor-font-wrapper';
let clone = this.body.cloneNode(true);
clone.querySelectorAll('blockquote.rl-bq-switcher').forEach(
node => node.classList.remove('rl-bq-switcher','hidden-bq')
);
clone.querySelectorAll('.rlBlockquoteSwitcher').forEach(
node => node.remove()
);
clone.querySelectorAll('['+attr+']').forEach(
node => node.removeAttribute(attr)
);
return clone.innerHTML;
}
if (this.isPgpEncrypted()) {
return this.html() || plainToHtml(this.plain());
}
return '';
return this.html() || plainToHtml(this.plain());
}
/**