GrapesJS / mjml

Newsletter Builder with MJML components in GrapesJS
http://grapesjs.com/demo-mjml.html
BSD 3-Clause "New" or "Revised" License
624 stars 222 forks source link

<mj-social-element> puts text inside <img> element #267

Open stevedrobinson opened 2 years ago

stevedrobinson commented 2 years ago

When I compare the behavior between https://mjml.io and their "Try it Live" editor and grapejs-mjml, they treat the tag diffferently.

mjml.io renders the <mj-social-element> tag with the icon next to text using two table cells, one for the image, and one for the text sort of like this (this is super simplified):

<table>
  <tr>
    <td>
        <a><img/></a>
    </td>
    <td>
      <a>text</a>
    </td>
  </tr>
</table>

When grapesjs-mjml renders the <mj-social-element> it renders it like this:

<table>
  <tr>
    <td>
      <a><img>text</img></a>
    </td>
  </tr>
</table>

I don't think this is intentional, since putting text inside of an image tag is pretty unusual.