djhtml icon indicating copy to clipboard operation
djhtml copied to clipboard

CSS Indentation inside Block used for css extension

Open BonaFideIT0 opened this issue 1 year ago • 0 comments

A pretty common usecase is to have a base template that looks something like that:

<style>
    {% block style %}
        .somecss {
            someproperty: somevalue;
        }
    {% endblock %}
</style>

Next we have a template extending this template like so:

{% block style %}
    {{ block.super }}
    .somemorecss {
        somemoreproperty: somemorevalue;
    }
{% endblock %}

After running the hook we get something that looks like this in the extended template:

{% block style %}
    {{ block.super }}
    .somemorecss {
    somemoreproperty: somemorevalue;
    }
{% endblock %}

I guess thats due to the fact that the parser does not encounter a style tag beforehand?

Is there something you can do about that?

Sincere thanks for your work so far. :)

BonaFideIT0 avatar Feb 08 '24 07:02 BonaFideIT0