From f56304775a30efb64cb356ef2a6add1997899a72 Mon Sep 17 00:00:00 2001 From: alma Date: Fri, 25 Apr 2025 22:11:33 +0200 Subject: [PATCH] panel 2 courier api restore --- components/ComposeEmail.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/components/ComposeEmail.tsx b/components/ComposeEmail.tsx index 7f64eb14..a008d984 100644 --- a/components/ComposeEmail.tsx +++ b/components/ComposeEmail.tsx @@ -192,12 +192,14 @@ export default function ComposeEmail({ // Get the proper content with minimal sanitization to preserve structure let emailContent = ''; if (decoded.html) { - // Preserve the HTML structure with minimal cleaning + // Allow ALL HTML elements and attributes to fully preserve formatting emailContent = DOMPurify.sanitize(decoded.html, { - ADD_TAGS: ['style', 'meta'], - ADD_ATTR: ['class', 'id', 'style', 'align', 'border', 'cellpadding', 'cellspacing', 'width', 'height'], - KEEP_CONTENT: true, - WHOLE_DOCUMENT: false + ADD_TAGS: ['style', 'meta', 'link', 'script'], + ADD_ATTR: ['*', 'style', 'class', 'id', 'src', 'href', 'target', 'rel', 'align', 'valign', 'border', 'cellpadding', 'cellspacing', 'bgcolor', 'width', 'height'], + ALLOW_UNKNOWN_PROTOCOLS: true, + WHOLE_DOCUMENT: true, + RETURN_DOM: false, + KEEP_CONTENT: true }); } else if (decoded.text) { emailContent = `
${decoded.text}
`; @@ -210,7 +212,7 @@ export default function ComposeEmail({

${emailHeader} -