jdrouet / mrml

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

Preserve whitespace between inline Elements #439

Closed ushi-as closed 5 months ago

ushi-as commented 5 months ago

MRML removes all whitespace between consecutive inline elements inside mj-text. This breaks text with simple formatting elements like em or strong.

With the following input:

<mjml>
  <mj-body>
    <mj-text>
      <p>
        <em>foo</em> <strong>bar</strong>
      </p>
    </mj-text>
  </mj-body>
</mjml>

MRML generates:

<!doctype html>
<html>
  <!-- ... -->
  <p><em>foo</em><strong>bar</strong></p>
  <!-- ... -->
</html>

Whereas MJML generates:

<!doctype html>
<html>
  <!-- ... -->
  <p><em>foo</em> <strong>bar</strong></p>
  <!-- ... -->
</html>

Which is expected.

Tell me if you need more information.