Strange behavior with {%- -%} hyphened tags. Could this be a bug in liquid itself?

Shopify Expert
57 0 19


I am observing some really strange behavior when using the {%- -%} hyphened tags instead of just {% %}.

If I have this code:

{% capture shopName %}{{}} - Some text here{% endcapture %}

The output is:

"My Shop Name - Some text here"

If I have the same code with the hyphened tags:

{%- capture shopName -%}{{}} - Some text here{%- endcapture -%}

"My Shop Name- Some text here"

Notice how the blank space before the hyphen between "My Shop Name" and "Some text here" disappears.

Could this be a bug in the liquid parser or whatever component down the liquid pipeline?

Beautiful and responsive Shopify themes crafted with care at