fix(email): preserve <img style> in WYSIWYG so logo stays scaled
This commit is contained in:
@@ -55,7 +55,21 @@ export function RichTextEditor({
|
|||||||
heading: { levels: [2, 3] },
|
heading: { levels: [2, 3] },
|
||||||
}),
|
}),
|
||||||
Link.configure({ openOnClick: false }),
|
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),
|
content: swapCidToLogo(defaultValue || "<p></p>", logoDataUrl),
|
||||||
editorProps: {
|
editorProps: {
|
||||||
|
|||||||
Reference in New Issue
Block a user