mirror of
https://github.com/twigphp/Twig.git
synced 2026-11-01 00:25:57 +00:00
1d22d300fa
This reverts commit99c6fbd517, reversing changes made to868b429853.
69 lines
881 B
Plaintext
69 lines
881 B
Plaintext
--TEST--
|
|
Whitespace trimming on tags.
|
|
--TEMPLATE--
|
|
Trim on control tag:
|
|
{% for i in range(1, 9) -%}
|
|
{{ i }}
|
|
{%- endfor %}
|
|
|
|
|
|
Trim on output tag:
|
|
{% for i in range(1, 9) %}
|
|
{{- i -}}
|
|
{% endfor %}
|
|
|
|
|
|
Trim comments:
|
|
|
|
{#- Invisible -#}
|
|
|
|
After the comment.
|
|
|
|
Trim leading space:
|
|
{% if leading %}
|
|
|
|
{{- leading }}
|
|
{% endif %}
|
|
|
|
{%- if leading %}
|
|
{{- leading }}
|
|
|
|
{%- endif %}
|
|
|
|
|
|
Trim trailing space:
|
|
{% if trailing -%}
|
|
{{ trailing -}}
|
|
|
|
{% endif -%}
|
|
|
|
Combined:
|
|
|
|
{%- if both -%}
|
|
<ul>
|
|
<li> {{- both -}} </li>
|
|
</ul>
|
|
|
|
{%- endif -%}
|
|
|
|
end
|
|
--DATA--
|
|
return ['leading' => 'leading space', 'trailing' => 'trailing space', 'both' => 'both']
|
|
--EXPECT--
|
|
Trim on control tag:
|
|
123456789
|
|
|
|
Trim on output tag:
|
|
123456789
|
|
|
|
Trim comments:After the comment.
|
|
|
|
Trim leading space:
|
|
leading space
|
|
leading space
|
|
|
|
Trim trailing space:
|
|
trailing spaceCombined:<ul>
|
|
<li>both</li>
|
|
</ul>end
|