GrapesJS / mjml

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

Inline styles on links in mj-text are removed on html export #236

Closed mistergraphx closed 3 years ago

mistergraphx commented 3 years ago

Hi,

If a create a simple custom block,

<mj-text data-gjs-hoverable="false" data-gjs-selectable="false"
                    padding-top="10px" css-class="remove-lh cta-in-websitee"  >
                <a data-gjs-hoverable="true" data-gjs-selectable="true" 
                    href="https://website.com"
                    style="color:#272727 !important; background-color: #ABDBC6 !important;line-height:39px;font-size:16px;">
                    LINK
                </a>
</mj-text>

if i change the background color, when i export the html, the style attribute is removed on links.

It's the same with links in a simple text block, and it can be reproduce in the demo.

the grapesjs options, forceClass or avoidInlineStyles seems doing nothing in this case.

How can i change or bypass this behavior ?

Thanks for your answers

mistergraphx commented 3 years ago

Using the ckeditor plugin fix the issue