Open QuingKhaos opened 7 years ago
Jinja2 and I think some other template systems use this also.
Yes, twig is basically jinja2 syntax. But I don't know if Jinja2 itself has also this whitespace control :)
It does, which is nice. I don’t know Twig so I don’t know if it works exactly the same way, but that is how you would do whitespace control.
NB Prolog and Erlang and possibly other languages have generic nested data structures that include {{
for example: {{a, nested, tuple}, inside, a tuple}
but {[{ a, tuple}, {that, is}, {part, of}, {a, list}]}
so I'm not sure how you could manage these sorts of edge cases.
Yeah, I was thinking of C++ now doing that too. But having tuples nested exactly two deep where the first element of the first tuple is negative is pretty rare. The {{
or }}
character sequence might be incorrectly ligatured, but if it just displays with the characters closer together like ..
, --
, >>
, etc., the false positives won’t be that big a deal.
I just realized that this is a duplicate of #244
Hi, can we have optimized ligatures for Twig syntax? The standard symbols are:
{% some_instruction %}
{{ some_variable }}
{# this is a comment #}
and with whitespace control:
{%- some_instruction -%}
{{- some_variable -}}