Format on Save in HTML - Closing Tags XHTML style instead of HTML5 #23944
Replies: 2 comments
-
This would need to be something supported by Prettier. I don't see a configuration option relating to this, and it seems that they're philosophically against it, at least as of 2018. |
Beta Was this translation helpful? Give feedback.
-
@maxdeviant Maybe formatting should be handled by "HTML Language Features" then. It has no strong opinion :) I checked the defaults in VS Code and Fleet, they both have this reformat feature out of the box and it does not do multiple line breaks (for which I saw people complaining about in other issues), nor close inline tags with forward slash. That could be the right way to do it out of the box, and Prettier should probably be available as a plugin. |
Beta Was this translation helpful? Give feedback.
-
Check for existing issues
Describe the bug / provide steps to reproduce it
In HTML, when Format on Save is enabled, HTML tags that were closed with
>
are being reformatted to XHTML style/>
.For example, if the code is written like this:
it will always reformat to be closed XHTML style ('/>'), like this:
While the self-closing form is valid, the more conventional and common way in HTML5 is to write it as '>', without the trailing slash.
Environment
Zed 0.153.6
macOS Sequoia 15.0
Chip: Apple M1 Pro
If applicable, add mockups / screenshots to help explain present your vision of the feature
No response
If applicable, attach your Zed.log file to this issue.
Zed.log
Beta Was this translation helpful? Give feedback.
All reactions