harttle/liquidjs

Whitespace / newlines are removed from after endif

cirosantilli opened this issue · 2 comments

Not sure if intentional but e.g. on the live demo: https://liquidjs.com/playground.html#YXNkZnslIGlmIHRydWUgLSV9eyUgZW5kaWYgLSV9Cgpxd2Vy,e30= the input of:

asdf{% if true -%}{% endif -%}

qwer

outputs:

asdfqwer

removing any newlines that come after.

Adding a space after endif doesn't help, but adding a non whitespace character like a does.

A workaround I found is to add an empty string:

asdf{% if true -%}{% endif -%}{{""}}

qwer

I think you need drop the last ‘-‘. And there’s a tutorial for blanks https://liquidjs.com/tutorials/whitespace-control.html

ah thanks