theme-tools icon indicating copy to clipboard operation
theme-tools copied to clipboard

liquid format error

Open RhinoLu opened this issue 2 years ago • 2 comments

Describe the bug The minus sign should stick with the percentage sign.

Unformatted source

{%-if customer.name==some_name-%}{%-endif-%}

Expected output

{%- if customer.name == some_name -%}{%- endif -%}

Actual output

{%- if customer.name == some_name- %}{%- endif -%}

Debugging information

  • Mac
  • Version 1.0.6

Additional context Prettier_Liquid_Plugin_-_Playground

RhinoLu avatar Mar 28 '23 02:03 RhinoLu

Argh. That's because - is ambiguous here. It's a valid variable name character and it is a character used to close the tag.

I would have to verify if the ruby parser considers it as a variable character or as a character to close the tag for whitespace stripping.

charlespwd avatar Mar 28 '23 13:03 charlespwd

Alright so ruby parser considers it as closing tag character. Indeed a bug.

charlespwd avatar Mar 28 '23 13:03 charlespwd