Closed bigbanana80 closed 1 month ago
Django templates are not HTML, and treating them as HTML will result in issues like this. See issue in underlying prettier
: https://github.com/prettier/prettier-vscode/issues/3441
Short of the VS Code extension itself knowing (via language configuration) that the .html
files are not actually HTML, I'd say that this is really just a deficiency in prettier
itself.
I'd suggest configuring your .prettierignore
to ignore your Django templates.
Summary
when formatting
html
with prettier, Django templates tags are formatted wrong which breaks the templateGithub Repository to Reproduce Issue
https://github.com/bigbanana80/Septo-PC
Steps To Reproduce:
Expected result
it should format it like this (or somehow like this)
Actual result
instead, it format it like this which breaks the page at the {% block part
Additional information
VS Code Version: Version: 1.90.2 (user setup) Commit: 5437499feb04f7a586f677b155b039bc2b3669eb Date: 2024-06-18T22:34:26.404Z Electron: 29.4.0 ElectronBuildId: 9728852 Chromium: 122.0.6261.156 Node.js: 20.9.0 V8: 12.2.281.27-electron.0 OS: Windows_NT x64 10.0.22631
Prettier Extension Version: v10.4.0 OS and version: Windows 11 , Version 10.0.22631 Build 22631
Prettier Log Output