jdrouet / mrml

Implementation of mjml in rust
MIT License
362 stars 24 forks source link

Support void (self-closing) HTML elements in mj-raw #432

Open tstriker opened 5 months ago

tstriker commented 5 months ago

I bumped into this while switching from node version to the python one (which is a port of this lib, i believe).

There is a number of 'void' elements that do not require closing in HTML: https://developer.mozilla.org/en-US/docs/Glossary/Void_element

however, the lib right now seems to be tripping on them with "unexpected end of stream"

the node version does not seem to have a similar limitation, so seems like could be useful to address these void elements.

thank you for the lib!

jdrouet commented 5 months ago

Hey, Could you provide an example? I'm already hunting them but some might not be caught by the CI

tstriker commented 5 months ago

Updated the bug title as i realized that it is specific to contents of mj-raw. Here's a quick snippet of MJML that triggers the unexpected end of stream:

<mjml>
  <mj-body>
    <mj-raw>
      <img src="bananas">
    </mj-raw>
  </mj-body>
</mjml>