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: {