1

I'm having issues using mjml where I want to specify inline CSS, but it's currently not supported by Prettier as far as I could tell.

The only way I found how to bypass this is using <!-- prettier-ignore --> but mjml is expecting this to be a CSS block (like <style>). So to make this work I would need to use /* prettier-ignore */ but it's not recognized by Prettier because it thinks I'm inside an XML block.

Is there a way to tell that this block is CSS? Something like

<!-- prettier-type: css -->

I'm sort of running in circle trying to fix this problem!

Nicolas Bouvrette
  • 4,295
  • 1
  • 39
  • 53

1 Answers1

0

Based on the lack of answers, I suppose this is not possible and the only real way to fix this would be to add proper MJML support to Prettier.

In the meantime the following workaround can be used to allow using both inline CSS and the MJML online editor:

<!-- prettier-ignore -->
<mj-style inline="inline">
/** CSS here */
</mj-style>
Nicolas Bouvrette
  • 4,295
  • 1
  • 39
  • 53