tera
tera copied to clipboard
`if` statement with parens fails to parse
The following fails to parse with tera but works fine with jinja2:
{% if (brand.id == "barfoo") or (brand.id == "foobar") %}LOL{% endif %}
with the following error:
Tera error: Error { kind: Msg("Failed to parse 'test.html'"), source: Some(Error { kind: Msg(" --> 1:17\n |\n1 | {% if (brand.id == \"barfoo\") or (brand.id == \"foobar\") %}LOL{% endif %}\n | ^---\n |\n = expected `+`, `-`, `*`, `/`, or `%`"), source: None }) }
Changing the template to something more reasonable also fails with the exact same error:
{% if (brand.id == "barfoo" or brand.id == "foobar") %}LOL{% endif %}
I know the first example is a bit silly and you're not aiming for 100% jinja compatibility but do you think this could be fixed?
Thanks in advance!
I've just added a test in the next version for that (https://github.com/Keats/tera2/commit/c5dc6c9b5cfad6ae54ecc4a6f4bfc58641e29e3f) and it works
Do you have a rough timeline for when we can expect terra2? Are we talking days, weeks or months? 😄
Definitely closer to months. A beta release will be tested for quite some time in Zola before actually releasing v2 proper
@Keats I just created a PR that should fix the issue, I'd greatly appreciate if you could have a look: https://github.com/Keats/tera/pull/908 :pray: