-
-
Notifications
You must be signed in to change notification settings - Fork 237
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
lenientIf not working as expected #313
Comments
It only works when used directly in {{ notDefined | default: 'foo' }}
{{ if notDefined }}
{{ unless notDefined }} It's purely allows you to test whether it's defined or not, so any additional computation is not allowed. |
Got it, thanks for the quick reply. Our software actually extends the ability to use liquid templates to our end users, and this comes up a lot when they write their own template code. They want to check an undefined variable against some value and don't realize they have to wrap that check in another if tag to see if the variable exists or not. We keep strict variables on just as another way to help them know if they've used incorrect variable names or not. Is there any appetite to extend the functionality of lenientIf to support my usecase? If so, I could work on a PR if there's the opportunity for it to get merged. |
I am having similar confusion about HTML
JS
|
@scottgeye the shortcut is to copy/paste the current |
## [9.23.1](v9.23.0...v9.23.1) (2021-02-19) ### Bug Fixes * lenientIf not working for the umd bundle, closes [#313](#313) ([2e66e8b](2e66e8b))
🎉 This issue has been resolved in version 9.23.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@emawby now fixed on 9.23.1, try again! |
Thank you for the quick fix! |
I tried setting lenientIf to true in the options, but I'm still getting an exception when an undefined variable is used in an if block. Please let me know if I'm i'm doing something wrong or if lenientIf doesn't work the way I think it does.
Thanks
The text was updated successfully, but these errors were encountered: