jdrouet / mrml

Implementation of mjml in rust
MIT License
344 stars 22 forks source link

feat(mrml-core): allow to have comments at root level #414

Closed jdrouet closed 5 months ago

jdrouet commented 5 months ago

As noted by #409, we currently cannot have a comment at the root of the template like following

<!-- not allowed -->
<mjml>
<mj-body>
<!-- allowed -->
</mj-body>
</mjml>

To fix that, I introduced a Root element which will be called when doing mrml::parse or mrml::async_parse and will only return the contained Mjml component. This means that the comment will be just ignored.