From c062b742afcebc45fa02b42b45468f8417845614 Mon Sep 17 00:00:00 2001 From: Nicole Orchard Date: Tue, 3 Dec 2024 09:00:03 -0600 Subject: [PATCH] Pass parent attributes to rawXML child components (#2922) * Pass parent attributes to child rawXML child components --------- Co-authored-by: Nicole Orchard Co-authored-by: Nicole Orchard --- 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..62b07efb4 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} + return jsonToXML(child) + }).join('\n') } const sibling = children.length