From 8d9694ba956a4e77f211dd0484bba96ae71056bd Mon Sep 17 00:00:00 2001 From: alma Date: Mon, 21 Apr 2025 15:21:30 +0200 Subject: [PATCH] mail page rest --- app/courrier/page.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/courrier/page.tsx b/app/courrier/page.tsx index d9dfc7fb..f0445f92 100644 --- a/app/courrier/page.tsx +++ b/app/courrier/page.tsx @@ -258,11 +258,12 @@ function renderEmailContent(email: Email) { // If we have HTML content, display it if (parsed.html) { + const decodedHtml = decodeMIME(parsed.html, 'quoted-printable', 'utf-8'); return (
]*>[\s\S]*?<\/style>/gi, '') .replace(/]*>[\s\S]*?<\/script>/gi, '') .replace(/]*>/gi, '') @@ -281,9 +282,10 @@ function renderEmailContent(email: Email) { // If we have text content, display it if (parsed.text) { + const decodedText = decodeMIME(parsed.text, 'quoted-printable', 'utf-8'); return (
- {parsed.text.split('\n').map((line: string, i: number) => ( + {decodedText.split('\n').map((line: string, i: number) => (

{line}

))}
@@ -310,7 +312,8 @@ function renderEmailContent(email: Email) { } // If we couldn't parse the content, try to clean and display the raw body - const cleanedContent = email.body + const decodedBody = decodeMIME(email.body, 'quoted-printable', 'utf-8'); + const cleanedContent = decodedBody .replace(/Content-Type:[^\n]+/g, '') .replace(/Content-Transfer-Encoding:[^\n]+/g, '') .replace(/MIME-Version:[^\n]+/g, '')