Skip to content

Commit c062b74

Browse files
norchardNicole OrchardNicole Orchard
authored
Pass parent attributes to rawXML child components (#2922)
* Pass parent attributes to child rawXML child components --------- Co-authored-by: Nicole Orchard <[email protected]> Co-authored-by: Nicole Orchard <[email protected]>
1 parent 74b4793 commit c062b74

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/mjml-core/src/createComponent.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,10 @@ export class BodyComponent extends Component {
207207
children = children || this.props.children
208208

209209
if (rawXML) {
210-
return children.map((child) => jsonToXML(child)).join('\n')
210+
return children.map((child) => {
211+
child.attributes = {...attributes, ...child.attributes}
212+
return jsonToXML(child)
213+
}).join('\n')
211214
}
212215

213216
const sibling = children.length

0 commit comments

Comments
 (0)