Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format XML #1579

Closed
infacto opened this issue Sep 29, 2020 · 2 comments
Closed

Format XML #1579

infacto opened this issue Sep 29, 2020 · 2 comments
Labels
locked Please open a new issue and fill out the template instead of commenting.

Comments

@infacto
Copy link

infacto commented Sep 29, 2020

Please add XML format feature. Reference: #505
Prettier has an official plugin for that: https://github.com/prettier/plugin-xml

I wonder, Prettier formats xml but not natively xml? Weird, but ok. It's slightly different.
Anyway, it would be great if the prettier-vscode extension supports formatting xml.
The "XML Tools" extension also formats XML. But really ugly. I like the behavior of Prettier for HTML. e.g. split attributes in line on line overflow, etc.

Alternative: How to tell Prettier / VS Code to handle XML like HTML to format the XML as HTML. I think this will work in the very most of cases. For example: I want to format SVG. But also default XML.

Update: A workaround could be: In VS Code settings.json:

"files.associations": {
  "*.svg": "html",
  "*.xml": "html"
},

It works more or less. That has to be tested for longer time. This is just a workaround. I hope for an official solution. Maybe just use the html-formatter for xml and co (svg) for the first step.

@ntotten
Copy link
Member

ntotten commented Oct 1, 2020

Use the plugin. https://github.com/prettier/prettier-vscode#plugins

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot added the locked Please open a new issue and fill out the template instead of commenting. label Dec 31, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked Please open a new issue and fill out the template instead of commenting.
Projects
None yet
Development

No branches or pull requests

2 participants