GrapesJS / mjml

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

adding mj-styles or mj-head if they don't exist #343

Open rogueturnip opened 7 months ago

rogueturnip commented 7 months ago

Hi!

I'm trying to setup my editor so that it can check the mjml content that's about to be used to validate it has the mj-head take with particular styles in mj-styles. I've tried using the getComponents followed by component.get (with a filter) to find those tags but it returns empty.

Is there a specific way I can validate the head exists and then the style that I'm looking for and if it doesn't use addComponent to insert the styles?

Thanks!