Shopify / prettier-plugin-liquid

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

Error raised when there is an `if` within a `capture` #211

Closed Rykus0 closed 9 months ago

Rykus0 commented 9 months ago

Describe the bug Error raised when there is an if within a capture

Unformatted source

{% capture header %}
  <header>
    <h1>{{ title }}</h1>
    {% if item_count > 0 %}
      <p>You are <b>$13.00</b> away from <b>free shipping</b>!</p>
      <progress max="100" value="75">
    {% else %}
      <p>{{ help_text_empty }}</p>
    {% endif %}
  </header>
{% endcapture %}

Expected output No error

Actual output LiquidHTMLParsingError: Attempting to close LiquidTag 'if' before LiquidBranch 'null' was closed

Debugging information

Additional context Add any other context about the problem here.

Rykus0 commented 9 months ago

Nevermind - this is my mistake. It was the unclosed <progress> that was the problem.