From de795842037ac1cf44e35d8b96a5520c7325a7f0 Mon Sep 17 00:00:00 2001 From: Nicole Orchard Date: Tue, 26 Nov 2024 21:19:08 -0600 Subject: [PATCH] Pass parent attributes to child rawXML child components --- packages/mjml-core/src/createComponent.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/mjml-core/src/createComponent.js b/packages/mjml-core/src/createComponent.js index 0d4c655e5..fb357f873 100644 --- a/packages/mjml-core/src/createComponent.js +++ b/packages/mjml-core/src/createComponent.js @@ -207,7 +207,10 @@ export class BodyComponent extends Component { children = children || this.props.children if (rawXML) { - return children.map((child) => jsonToXML(child)).join('\n') + return children.map((child) => { + child.attributes = {...attributes, ...child.attributes} + jsonToXML(child) + }).join('\n') } const sibling = children.length