Skip to content

Commit

Permalink
Pass parent attributes to rawXML child components (#2922)
Browse files Browse the repository at this point in the history
* Pass parent attributes to child rawXML child components
---------

Co-authored-by: Nicole Orchard <[email protected]>
Co-authored-by: Nicole Orchard <[email protected]>
  • Loading branch information
3 people authored Dec 3, 2024
1 parent 74b4793 commit c062b74
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/mjml-core/src/createComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c062b74

Please sign in to comment.