Preserve image accessibility and dimensions in MJML
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 17:54:05 +05:30
1 parent 1c05e02d94
commit 07ed6b2596
4 files changed
+32 -4

No files matched your search

+1 -1
View File
@@ -382,7 +382,7 @@ export const imageBlock = leaf(
node,
),
mjml: ({ node }) =>
`<mj-image src="${html(attrs(node).src)}" alt="${html(attrs(node).alt)}" width="${html(attrs(node).width)}px" />`,
`<mj-image src="${html(attrs(node).src)}" alt="${html(attrs(node).decorative ? "" : attrs(node).alt)}" width="${html(attrs(node).width)}px" height="${html(attrs(node).height)}px" />`,
},
({ node }) => (attrs(node).decorative ? "" : `[${String(attrs(node).alt)}]\n\n`),
);