You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I also have a problem with variables in filter arguments, which seems different but perhaps is related.
Take this template, where match is a filter that matches the input to a regex and returns an object with a boolean field ok if the match worked, and a series of fields b0, b1, ... for each capturing group.
Also, ifelse is a function that returns the first argument if the input is true, the second otherwise:
{% let X = description | match(", (.+) ([0-9]+\\.[0-9]+) per CHF ([0-9]+\\.[0-9]+)") %}
{% let Y = { "ok": true, "g0": "ciao" } %}
category {% if X.ok %} {{X.g0}} {% else %} {{currency}} {% endif %}
{{ X | show }}
{{ Y | show }}
{{ Y.ok | ifelse(Y.g0, 1) }}
{% endlet %}
{% endlet %}
Both show print an object with ok and g0, and everything works.
However, if I replace ifelse(X.g0, 1) for ifelse(Y.g0, 1) I get the error
Example:
Error:
The text was updated successfully, but these errors were encountered: