Shopify / prettier-plugin-liquid

Prettier Liquid/HTML plugin
https://npm.im/@shopify/prettier-plugin-liquid
MIT License
93 stars 15 forks source link

Invalid MSO comments after formatting #110

Closed malonecj closed 1 year ago

malonecj commented 1 year ago

Describe the bug We are using the Prettier plugin to format email content containing liquid.

Many of these emails contain MSO (Microsoft Office) tags to add HTML / CSS anywhere in an email template. This code will be ignored by other email clients. Here’s what it looks like:

<!--[if mso]>
    <table><tr><td>
        /* Outlook-specific HTML content goes here. */
    </td></tr></table>
<![endif]-->

However, when we use the Prettier plugin, it is also formatting the comments, making them invalid and thus breaks the functionality in MS Outlook.

Unformatted source

 <!--[if mso]>
  </td>
  <td align="left">
      <![endif]-->

Expected output

 <!--[if mso]>
  </td>
  <td align="left">
      <![endif]-->

Actual output

 <!--
  [if mso]>
  </td>
  <td align="left">
      <![endif]
-->

Debugging information

Additional context Start tags like must be on the same line