-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Whitespace flags not respected on blocks (for/if) #79
Comments
Opening a PR to fix this. |
hi, @chrisghill What to Publish a New Version, fix bug |
Hey @zsdyx. I'm sorry, I don't understand what you asked. |
The proposed pull request does not completely fix the issue as "block" nodes have actually 4 trim params: left outside, right inside, left inside, right outside and in PR it handles only "outside" trims. That would be great to have all whitespace trim issues fixed some day :) |
... and with if/elsif/else it's getting even worse 😨 |
I also notices the whitespace control does not match normal liquid behavior and opened a PR with an attempt to fix it. Feedback is much appreciated :) |
Checklist
IsTemplateError
returns false.)Expected Behavior
Respect whitespace flags in
for
andif
blocks.with
Should render as
My friends are:alice,bob,and I like them!
https://liquidjs.com/playground.html#TXkgZnJpZW5kcyBhcmU6Cgp7JS0gZm9yIGZyaWVuZCBpbiBwZW9wbGUgLSV9Cnt7IGZyaWVuZCB9fSwKeyUtIGVuZGZvciAtJX0KCmFuZCBJIGxpa2UgdGhlbSE=,eyJwZW9wbGUiOiBbImFsaWNlIiwgImJvYiJdfQ==
Actual Behavior
Whitespace flags are ignored:
Detailed Description
It seems the TrimLeft and TrimRight functions aren't invoked at the block level.
Possible Solution
Invoke TrimLeft and TrimRight on the block during rendering.
The text was updated successfully, but these errors were encountered: