Bugfix: HTMLTemplateElement never has a <body> element

This commit is contained in:
the-djmaze 2022-03-09 16:53:04 +01:00
parent 6f2f5bce86
commit 0106751e64
2 changed files with 28 additions and 27 deletions

View file

@ -409,13 +409,6 @@ export class MessageModel extends AbstractModel {
body.classList.toggle('html', 1);
body.classList.toggle('plain', 0);
// Drop Microsoft Office style properties
const rgbRE = /rgb\((\d+),\s*(\d+),\s*(\d+)\)/g,
hex = n => ('0' + parseInt(n).toString(16)).slice(-2);
body.querySelectorAll('[style*=mso]').forEach(el =>
el.setAttribute('style', el.style.cssText.replace(rgbRE, (m,r,g,b) => '#' + hex(r) + hex(g) + hex(b)))
);
// showInternalImages
const findAttachmentByCid = cid => this.attachments().findByCid(cid);
body.querySelectorAll('[data-x-src-cid],[data-x-src-location],[data-x-style-cid]').forEach(el => {