From 26e4af97bca11ca57ccb01e1494cfd89d00bcf00 Mon Sep 17 00:00:00 2001 From: Gerhard Scheikl Date: Sat, 9 May 2026 08:22:07 +0200 Subject: [PATCH] fix(email): preserve in WYSIWYG so logo stays scaled --- app/components/RichTextEditor.tsx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/app/components/RichTextEditor.tsx b/app/components/RichTextEditor.tsx index 9fb6c97..fc2c6f8 100644 --- a/app/components/RichTextEditor.tsx +++ b/app/components/RichTextEditor.tsx @@ -55,7 +55,21 @@ export function RichTextEditor({ heading: { levels: [2, 3] }, }), Link.configure({ openOnClick: false }), - Image.configure({ inline: false, allowBase64: true }), + // Extend Image so the inline `style` attribute (e.g. max-height) is + // preserved on parse — TipTap's default Image only keeps src/alt/title. + Image.extend({ + addAttributes() { + return { + ...this.parent?.(), + style: { + default: "max-height:48px;", + parseHTML: (el) => (el as HTMLElement).getAttribute("style"), + renderHTML: (attrs) => + attrs.style ? { style: attrs.style as string } : {}, + }, + }; + }, + }).configure({ inline: false, allowBase64: true }), ], content: swapCidToLogo(defaultValue || "

", logoDataUrl), editorProps: {