mirror of
https://github.com/askama-rs/askama.git
synced 2025-09-28 13:30:59 +00:00

This PR adds `{% break %}` and `{% continue %}` statements to break out of a loop, or continue with the next element of the iterator.
12 lines
266 B
HTML
12 lines
266 B
HTML
{%- for v in values -%}
|
|
x {{- v -}}
|
|
{%- if matches!(v, x if *x > 9) -%}
|
|
{%- if matches!(v, x if *x % 2 == 0) -%}
|
|
{%- break -%}
|
|
{%- else -%}
|
|
{%- continue -%}
|
|
{%- endif -%}
|
|
{%- endif -%}
|
|
y
|
|
{%- endfor -%}
|