Fix mail headers sometimes not appearing in the resulting pdf

master
Kuba Orlik 3 years ago
parent 44b3cfe6de
commit 7eea974679

@ -47,15 +47,11 @@ if (!html.includes("<body")) {
</body>`; </body>`;
} }
if ( for (const str_to_remove of [
html.includes( `<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-2">`,
`<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-2">` `<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">`,
) ]) {
) { html = html.replace(str_to_remove, "");
html = html.replace(
`<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-2">`,
""
);
} }
if (!html.includes(`<meta charset="utf-8"`)) { if (!html.includes(`<meta charset="utf-8"`)) {
@ -182,7 +178,7 @@ for (const inline_attachment of inline_attachments) {
} }
html = html.replace( html = html.replace(
/<body>/i, /<body[^>]*>/i,
`<body>` + `<body>` +
/* HTML */ `<h1>${subject}</h1> /* HTML */ `<h1>${subject}</h1>
<table> <table>

Loading…
Cancel
Save