Shopify Liquid formatter doesn't format a HTML in a default Shopify's email template.
Describe the bug I copy an email template from notifications - Edit order confirmation, into vs code. Formatting with Shopify liquid does not structure HTML, that I can work easily. In addition HTML formatter brokes the template (HTML language features formatter), so there is no way to make the layout looks readable.
Source Copy the template from default shopify's customer notification template "Edit Order confirmation" in to VS code, try to format with Shopify Liquid.
Expected behaviour Html becomes readable, liquid is readable also. Template's UI doesn't lose any elements
Actual behaviour HTML isn't formatted. Liquid is readable. Template doesn't lose elements.
Debugging information
- OS Mac "Sequoia 15.1.1"
- Shopify CLI version "3.74.1"
- Theme Check Version "unknown"
- Shopify Liquid extension version "3.5.3"
Additional context
I don't know this for certain, but I have a strong suspicion that the following part of the template is responsible for this issue
{% if expand_bundles and line.bundle_parent? %}
<td class="order-list__parent-price-cell">
{% else %}
<td class="order-list__price-cell">
{% endif %}
{% if line.original_line_price != line.final_line_price %}
<del class="order-list__item-original-price">{{ line.original_line_price | money }}</del>
{% endif %}
<p class="order-list__item-price">
{% if line.final_line_price > 0 %}
{{ line.final_line_price | money }}
{% else %}
Free
{% endif %}
</p>
</td>
I can see why a tool would have difficulty with this. This is technically legal within liquid, and it does work, but it also completely breaks the hierarchy that a formatting tool would use to format it. I couldn't even tell you what the right way to format this is.