{% for a in b %} {{ a }} {% else %} Hello world! {% endfor %}
{% if condition %} {{ condition }} {% else %} Hello world! {% endif %}
{% unless condition %} Hello world! {% elsif other %} {{ condition }} {% endunless %}
It should indent when statements and their children
{% case pastry %} {% when 'oopsie' %} {% when 'croissant' %} Mmmm {% when 'muffin' %} Yea. Alright. {% when 'veggie' %} That's not a pastry! {% else %} What do you want? {% endcase %}
When there's a TextNode child, it should format the children as a paragraph
{% if a %} hello {{ world }}! {% elsif b %} {% if x %}Greetings{% else %}Hello{% endif %}, friend! {% endif %}
When there's aren't TextNodes children, it should break every child on a new line.
{% if a %}
Hello
content
{% elsif b %} {% if greeting %}
hello
{% endif %}
content
{% endif %}
When there's a new line in the input, there should be a new line in the output. {% if a -%} hello {% endif %} {% if a -%} hello {%- elsif b -%} b {%- else -%} c {% endif %} Deeply nested tags should break line {% if greeting %}hello world{% endif %} {% if greeting -%} hello world {%- endif %}