Breaks tags with newline when formatting on save
See original GitHub issueThis (or something else?) puts a newline inside django tags:
{% include 'elements/addedit_campaign_modal.html' with editing=True %} {% endblock %}
becomes:
{% include 'elements/addedit_campaign_modal.html' with editing=True %} {%
endblock %}
and this leads to the syntax error. Any suggestions appreciated!
This is in my settings.json:
"files.associations": {
"**/*.html": "html",
"**/templates/**/*.html": "django-html",
"**/templates/**/*": "django-txt",
"**/requirements{/**,*}.{txt,in}": "pip-requirements"
},
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (1 by maintainers)
Top Results From Across the Web
VSCode breaks Django template tags with newline
Automatically format *.html files, while preserving django template tags, not breaking them up with newlines. Sub-optimal (but acceptable) ...
Read more >HTML Line Break – How to Break a Line with the HTML <br ...
You can insert line breaks in HTML with the <br> tag, which is equivalent to a carriage return on a keyboard. Be aware...
Read more >HTML Tutorial - Line Breaks
Use the line break tag to solve minor formatting issues, save larger page layout issues for tables and the align attribute. Remember that...
Read more >Basic Formatting | HTML text formatting, paragraphs and line ...
Formatting the Text | Tag Questions | Skipping Lines | Attributes | Headings · So let's see them! ... You use <br> ,...
Read more >Preserving Line Breaks When Using Jsoup | Baeldung
Thus, by prepending <br> and <p> HTML tags with the newline character, and disabling the pretty-print output setting of Jsoup, we can preserve ......
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
No news, but what I do is sprinkle in
to protect the tag from formatting.
@batisteo help!
I think the point is to make the formatter smarter, not to disable formatting altogether.