1

Resolved

VS 2013 Django Format document removes new lines between django tags

description

VS 2013 Update 2

Reformatting the following template:
{% if article.question_set.all.count > 0 %}
    {% if article.has_ended %}
        <p class="error">Ended.</p>
    {% elif participated and not article.allow_multi_vote %}
        <p class="error">Thank you!</p>
    {% endif %}
{% endif %}
results in this:
{% if article.question_set.all.count > 0 %}{% if article.has_ended %}
        <p class="error">Ended.</p>{% elif participated and not article.allow_multi_vote %}
        <p class="error">Thank you!</p>{% endif %}
{% endif %}

comments

pminaev wrote May 6 at 12:04 AM

For 2.1, this is resolved by disabling auto-formatting (both explicit commands, and triggered indirectly by paste etc) for Django templates.

In the future, it would be nice to support this, and the new VS HTML editor does have extensibility points for it, but they do not provide everything that we need to do this right and without hacks - we should revisit this once that changes.