From 7eea974679090d67370717cb0fd9f9e2c13a68a8 Mon Sep 17 00:00:00 2001 From: Kuba Orlik Date: Wed, 22 Dec 2021 19:40:19 +0100 Subject: [PATCH] Fix mail headers sometimes not appearing in the resulting pdf --- mail-to-pdf.mjs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/mail-to-pdf.mjs b/mail-to-pdf.mjs index 59d9092..0c25fe2 100755 --- a/mail-to-pdf.mjs +++ b/mail-to-pdf.mjs @@ -47,15 +47,11 @@ if (!html.includes("`; } -if ( - html.includes( - `` - ) -) { - html = html.replace( - ``, - "" - ); +for (const str_to_remove of [ + ``, + ``, +]) { + html = html.replace(str_to_remove, ""); } if (!html.includes(`/i, + /]*>/i, `` + /* HTML */ `

${subject}