Skip to content

Commit 403bd9d

Browse files
committed
minor #4649 Coding standard suggestion about empty content (VincentLanglet)
This PR was merged into the 3.x branch. Discussion ---------- Coding standard suggestion about empty content Hi `@fabpot` As suggested by `@stof` symfony/symfony#60761 (comment) This would allow writing `{#--#}` rather than `{#- -#}` when following the twig coding standard. Commits ------- 0b93a1f Stof suggestion about empty content
2 parents 7dca48a + 0b93a1f commit 403bd9d

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

doc/coding_standards.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ When writing Twig templates, we recommend you to follow these official coding
1111
standards:
1212

1313
* Put exactly one space after the start of a delimiter (``{{``, ``{%``,
14-
and ``{#``) and before the end of a delimiter (``}}``, ``%}``, and ``#}``):
14+
and ``{#``) and before the end of a delimiter (``}}``, ``%}``, and ``#}``)
15+
if the content is non empty:
1516

1617
.. code-block:: twig
1718
1819
{{ user }}
19-
{# comment #}
20+
{# comment #} {##}
2021
{% if user %}{% endif %}
2122
2223
When using the whitespace control character, do not put any spaces between
@@ -25,7 +26,7 @@ standards:
2526
.. code-block:: twig
2627
2728
{{- user -}}
28-
{#- comment -#}
29+
{#- comment -#} {#--#}
2930
{%- if user -%}{%- endif -%}
3031
3132
* Put exactly one space before and after the following operators:

0 commit comments

Comments
 (0)