fix(email-renderer): export builder rows as valid MJML columns
Quality / quality (ubuntu-latest) (push) Failing after 1s
Quality / quality (windows-latest) (push) Canceled after 0s

This commit is contained in:
Clintchiz committed 2026-09-05 13:19:45 +05:30
1 parent b915a2206f
commit 8e51b28583
3 files changed
+22 -3

No files matched your search

+7 -2
View File
@@ -158,8 +158,13 @@ export const sectionBlock = defineBlock({
`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td class="section"><table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">${slots.content}</table></td></tr></table>`,
node,
),
mjml: ({ node, slots }) =>
`<mj-section background-color="${html(attrs(node).background)}" padding="${html(attrs(node).padding)}"><mj-column>${slots.content}</mj-column></mj-section>`,
mjml: ({ node, slots }) => {
const children = node.slots.content ?? [];
const body = children.length === 1 && children[0]?.type === "layout.columns"
? slots.content
: `<mj-column>${slots.content}</mj-column>`;
return `<mj-section background-color="${html(attrs(node).background)}" padding="${html(attrs(node).padding)}">${body}</mj-section>`;
},
},
textRenderer: ({ slots }) => `${slots.content}\n`,
} satisfies BlockDefinition);