fix(email): preserve <img style> in WYSIWYG so logo stays scaled

This commit is contained in:
Gerhard Scheikl
2026-05-09 08:22:07 +02:00
parent 67204d79ac
commit 26e4af97bc
+15 -1
View File
@@ -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 || "<p></p>", logoDataUrl),
editorProps: {