How to improve the readability of block scalars when used with jinja

Hello everyone.
Block scalars are described here.

The goal is to be improve the readability of the following block scalar example and obtain the intended value for the variable:


- set_fact:
variable: "{% if condition_1 is true %}{% if condition_2 is true %}'value'{% else %}'another value'{% endif %}{% else %}{{ another_variable }}{% endif %}"

I unsuccessfully tried:


- set_fact:
variable: >-
"{% if condition_1 is true %}
{% if condition_2 is true %}
'value'
{% else %}
'another value'
{% endif %}
{% else %}
{{ another_variable }}
{% endif %}"

Unfortunately, some spaces are added in the variable set value and there does not seem to be a way to completely “prune” them.

Am I missing something?

See https://jinja.palletsprojects.com/en/master/templates/#whitespace-control

Thanks @sivel.
This is possible with: