Closed pieroxy closed 7 years ago
I forgot to say I was infinitely grateful for this project before complaining, so there, I said it :-)
hello @pieroxy! I confirm the issue. Since the syntax was copied by TextMate Freemarker bundle, it would be interesting to understand whether the issue is also there
Hi @pieroxy thanks for submitting your issue. Yes you're right when using those characters inside the if
directive you will get a syntax highlight problem. However, according to the freemarker docs you should use gt
and gte
in order to avoid this.
I'll leave the note that tackles this.
When you want to test if
x > 0
orx >= 0
, writing<#if x > 0>
and<#if x >= 0>
is WRONG, as the first>
will close the#if
tag. To work that around, write<#if x gt 0>
or<#if gte 0>
. Also note that if the comparison occurs inside parentheses, you will have no such problem, like<#if foo.bar(x > 0)>
works as expected.
I'll close this issue for now. But I'll try to integrate a solution maybe a warning when using those characters inside the if
directive. Let me know if you are able to use this approach.
Thanks,
Daniel
Well, the workaround works but it is less legible. And the syntax I use is perfecly legal freemarker. That said I understand your point. Thanks for taking the time.
<#if (a>b) && b==2>
the first>
will be interpreted as the end of the #if statement.