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

Loading…
Cancel
Save