HTML -> No Django template tags support {% tag %}
See original GitHub issuePrettier 1.15.3 Playground link
--parser html
--print-width 100
Input:
{% extends 'base.html' %}
{% block content %}
<div class="content"></div>
{% for item in items %}
{{ item.name }}
{% endfor %}
{% include '_template.html' %}
{% endblock %}
Output:
{% extends 'base.html' %} {% block content %}
<div class="content"></div>
{% for item in items %} {{ item.name }} {% endfor %} {% include '_template.html' %} {% endblock %}
Expected behavior:
{% extends 'base.html' %}
{% block content %}
<div class="content"></div>
{% for item in items %}
{{ item.name }}
{% endfor %}
{% include '_template.html' %}
{% endblock %}
Django’s (and other frameworks using this notation) {% tag %}{% endtag %}
should be treated like blocks. Right now prettier creates hell of a mess 😕
Issue Analytics
- State:
- Created 5 years ago
- Reactions:111
- Comments:38 (4 by maintainers)
Top Results From Across the Web
Built-in template tags and filters - Django documentation
This document describes Django's built-in template tags and filters. It is recommended that you use the automatic documentation, if available, ...
Read more >Prettier vscode extension not support Django template tags ...
When using "prettier.disableLanguages": ["django-html"] I got the below warning in VS Code: This feature is no longer supported.
Read more >Django Templates: Built-In Tags and Filters - Real Python
You'll get to know Django templates through the tags and filters you use to compose reusable HTML. In this tutorial, you'll learn how...
Read more >Django Template Tags - W3Schools
Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, PHP, Python,...
Read more >Create Custom Template Tags and Filters in Django - Pluralsight
The Django template language offers a wide range of built-in tags and filters ... named users.html using the show_users_table template tag.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@robertquitt Any progress on that Django plugin?
This would greatly improve my life 😃