Formatting issues in HTML document editing with zed editor! #6799
Replies: 4 comments 4 replies
-
I like the formatting style of Atom. ![]() |
Beta Was this translation helpful? Give feedback.
-
Seems like Zed uses Prettier by default for formatting html, and addition of trailing slashes in spite of HTML standards is a long-standing issue with Prettier in particular. The workaround for this currently would be specifying an alternative formatter in settings, such as, for example, js-beautify, which you'll have to either install globally or include with your project. |
Beta Was this translation helpful? Give feedback.
-
Unrelated to @sagexiang question but I got here from a Google search on how to make the available width bigger than 80 on zed while saving with auto format on. If anyone is looking for this:
More option on Prettier API here. |
Beta Was this translation helpful? Give feedback.
-
@sagexiang The workaround I found was to just not use prettier. I'm using superHTML through the superHTML zed extension. This works almost exactly how you are describing you want prettier to work and you can read more about superHTML here. Here Is the configuration I found that works best (for some reason the configuration on the superHTML README page prevents the VSCode lsp from giving suggestions). {
"languages": {
"HTML": {
"formatter": { "language_server": { "name": "superhtml" } }
}
}
} |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I don’t like automatic formatting when saving an HTML document edited with zed editor. I don’t want to automatically add “/” to meta, img or link tags; the class attribute value “block” is originally at the front but goes to the end after automatic formatting. Went...The format style like Atom is very beautiful! how to solve it?

Thank you !
Beta Was this translation helpful? Give feedback.
All reactions