-
-
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
if tag condition, the token args is empty after updating from 10.19.1 to 10.20.0 or later #796
Comments
Hi @sidneyprins,
@harttle might be willing to reintroduce In this example import { Liquid } from "liquidjs";
const liquid = new Liquid();
const exampleTemplate = `\
Hello, {% if name %} {{ name }} {% else %} user {% endif %}
{%- assign you = 'Liquid' %}
G'day, {% if you %}{{ you }}{% else %}there{% endif %}!
`;
const context = {
name: "World",
};
const template = liquid.parse(exampleTemplate);
console.log(liquid.globalFullVariablesSync(template)); // [ 'name' ] |
Ah, sorry. |
## [10.20.3](v10.20.2...v10.20.3) (2025-02-09) ### Bug Fixes * empty tagToken.args since 10.20.0, fixes [#796](#796) ([38a0f51](38a0f51))
🎉 This issue has been resolved in version 10.20.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Thank you for the investigation @jg-rp, I released a fix just now @sidneyprins . Please let me know if |
Thanks for making a fix, issue is resolved! |
Hello,
We have a string
Hello, {% if name %} {{ name }} {% else %} user {% endif %}
When we update from 10.19.1 to 10.20.0 or later, our test starts to fail. We use the LiquidJS engine to read out all the different kinds of tokens and figure out which are required and optional.
The token
if
normally getsargs
filled withname
in this case, but since updating it returns an empty string.Version 10.19.1
See args
Version 10.20.0 or higher
See args
I have done some digging and found these changes.
Link:
File tags/if.ts, line 15 till 21
If I revert these changes, it works again.
When I run that specific function
item.token.tokenizer.readFilteredValue()
I get the following error.We have tried various versions of writing the strings, such as seen on https://liquidjs.com/tags/if.html, like
We're not sure how to make a fix for this part, can you help us?
The text was updated successfully, but these errors were encountered: