-
-
Notifications
You must be signed in to change notification settings - Fork 265
Description
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 gets args filled with name 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.
invalid value expression: "", line:1, col:18
>> 1| Hello, {% if name %} {{ name }} {% else %} user {% endif %}
^
TokenizationError: invalid value expression: "", line:1, col:18
at Tokenizer.error (/private/var/www/vhosts/mailer/node_modules/liquidjs/dist/liquid.node.js:1999:16)
at Tokenizer.assert (/private/var/www/vhosts/mailer/node_modules/liquidjs/dist/liquid.node.js:2003:24)
at Tokenizer.readFilteredValue (/private/var/www/vhosts/mailer/node_modules/liquidjs/dist/liquid.node.js:1841:14)
at eval (eval at <anonymous> (/private/var/www/vhosts/mailer/server/src/lib/helpers/liquid_helpers.ts:25:1), <anonymous>:1:22)
...
We have tried various versions of writing the strings, such as seen on https://liquidjs.com/tags/if.html, like
- {% if customer.name == "kevin" %} blabla {% endif %}
We're not sure how to make a fix for this part, can you help us?