Ok, many thanks. I more or less figured this out but you write it in a more
straight forward way than I do.

Le jeu. 4 juil. 2019 à 20:12, Jonathan Mayer <[email protected]> a
écrit :

> What works for me: I always consistently use "{%-" (the "remove all
> whitespace to the left" tag variant) for every command and comment.  Every
> command starts on a new line.  I only use the right-gobble in rare
> exceptional circumstances.
>
> By sticking with this style I get consistent and predictable results.
>
> If I need a new line, I'll do this:
>
> *Lorem ipsum.*
> *{# blank line #}*
> *{%- if condition %}*
> *  This could be indented.*
>
> *{%- else %}{# condition #}*
> *  This might be indented.*
> *{%- endif %}{# condition #}*
> *    Foo is indented.*
>
> Note that you need the minus on all commands, including the else clause,
> for consistent results.
>
> Left gobble is preferred over right gobble because indentation is common,
> but trailing whitespace is rare.
>
>
> On Tue, Jul 2, 2019, 2:52 AM Vincent Panel <[email protected]> wrote:
>
>> Hello,
>>
>> I'm struggling with indentation and whitespace control. I find it quite
>> counter-intuitive. Isn't there any way to just remove newlines left after a
>> block evaluation, without removing indentation ? For instance, let's take
>> the following example, where you have indented text and you just want to
>> have them without any blank line in between. Isn't there any better way
>> than the following example ?
>>
>>   Indented0
>> {%- if True %}
>>   Indented1
>> {% else %}
>>   Indented2
>> {% endif -%}
>> {##}  Indented3
>>   Indented4
>>   Indented5
>>
>> Thanks,
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "pocoo-libs" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/pocoo-libs.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/pocoo-libs/0653f2a4-9a80-478d-8b68-a54e9b408ccf%40googlegroups.com
>> <https://groups.google.com/d/msgid/pocoo-libs/0653f2a4-9a80-478d-8b68-a54e9b408ccf%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "pocoo-libs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/pocoo-libs.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pocoo-libs/CAKLzQ0r2-%2B1MeKAGuED8KrqMW1Q%2BdR0H0LcsEc9tU1QFASDSJA%40mail.gmail.com
> <https://groups.google.com/d/msgid/pocoo-libs/CAKLzQ0r2-%2B1MeKAGuED8KrqMW1Q%2BdR0H0LcsEc9tU1QFASDSJA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"pocoo-libs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/pocoo-libs.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pocoo-libs/CAAMRx6bwFxS0H4LrVrBkDCi3DTGXWNLMFn_vGwinVg5_gogU7Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to