Faire / mjml-react

React component library to generate the HTML emails on the fly
https://www.npmjs.com/package/@faire/mjml-react
MIT License
376 stars 16 forks source link

Add dangerouslySetInnerHTML prop to ending tags #42

Closed emmclaughlin closed 1 year ago

emmclaughlin commented 1 year ago

Addresses #15 and #16

dangerouslySetInnerHTML is not a recommended practice, but sometimes it is needed and therefore it makes sense to support it.

This PR adds support for dangerouslySetInnerHTML on all ending mjml tags (an ending mjml tag is one that supports html as children, rather than mjml. See the mjml docs here)

Also add a quick test on the MjmlRaw that the prop works