wix-incubator / mjml-react

React component library to generate the HTML emails on the fly

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Version 2.0.8 breaks templates

mrlubos opened this issue · comments

commented

Hey there! The latest version 2.0.8 seems to be breaking my templates.

Here's output from 2.0.7:

<tbody>
   <tr>
      <td align="left" style="font-size:0px;padding:0px;word-break:break-word;">
         <div style="font-family:-apple-system, BlinkMacSystemFont, &#x27;Segoe UI&#x27;, Roboto, &#x27;Helvetica Neue&#x27;, Arial, &#x27;Noto Sans&#x27;, sans-serif, &#x27;Apple Color Emoji&#x27;, &#x27;Segoe UI Emoji&#x27;, &#x27;Segoe UI Symbol&#x27;, &#x27;Noto Color Emoji&#x27;;font-size:30px;font-weight:400;line-height:38px;text-align:left;color:#068186;">Foo</div>
      </td>
   </tr>
</tbody>

And here's the same code output from 2.0.8:

<tbody>
   <tr>
      <td align="left" style="font-size:0;padding:0;word-break:break-word">
         <div style="font-family:-apple-system,BlinkMacSystemFont,&#x27;font-weight:400;line-height:38px;text-align:left;color:#068186">Foo</div>
      </td>
   </tr>
</tbody>

You can verify these don't produce the same visual result using the SendGrid UI editor for example, that's what I use. Also, please consider adding a changelog to this project so it's easier to identify which version might be breaking things! I had to go back to the latest known version and test each release to detect where the change occurred.

Are you passing minify: true ?

Difference between 2.0.7 and 2.0.8 is that passing minify: true actually does something in 2.0.8, previously it was deprecated in mjml. If you are passing minify: true then that should explain why it is breaking for you between 2.0.7 and 2.0.8.

commented

@daliusd Hi Dalius. Yes, I am passing minify: true in render() from mjml-react. I have many questions here but the most important one is: shouldn't minifying NOT alter the functionality? I honestly don't care about this parameter and it will be no issue setting it to false, but I'd expect my templates to work regardless of this flag's value.

That's what I would expect as well, but I guess minifiers are different and that's why I was reluctant adding anything at all into mjml-react.

I am closing this issue as everything works as expected for now.