In Liquid, you can include a hyphen in your tag syntax
-%} to strip whitespace from the left or right side of a rendered tag.
Normally, even if it doesn’t output text, any line of Liquid in your template will still output a blank line in your rendered HTML:
Notice the blank line before “tomato” in the rendered template:
By including hyphens in your assign tag, you can strip the generated whitespace from the rendered template:
If you don’t want any of your tags to output whitespace, as a general rule you can add hyphens to both sides of all your tags