This commit is contained in:
the-djmaze 2023-04-18 09:31:14 +02:00
parent 8630b418d1
commit c7cc250b1e

View file

@ -265,8 +265,6 @@ export const
}
tmpl.innerHTML = html
// Strip Microsoft comments
.replace(/<!--\[if[\s\S]*?-->/gi, '')
// .replace(/<pre[^>]*>[\s\S]*?<\/pre>/gi, pre => pre.replace(/\n/g, '\n<br>'))
// Not supported by <template> element
// .replace(/<!doctype[^>]*>/gi, '')
@ -280,8 +278,7 @@ export const
.trim();
html = '';
// \MailSo\Base\HtmlUtils::ClearComments()
// https://github.com/the-djmaze/snappymail/issues/187
// Strip all comments
const nodeIterator = document.createNodeIterator(tmpl.content, NodeFilter.SHOW_COMMENT);
while (nodeIterator.nextNode()) {
nodeIterator.referenceNode.remove();