Support for XML / SVG
It would be great if prettier could also check and format XML and SVG files. The formatting rules would be exactly the same as for JSX. Specificly for SVG, the contents of a `<style />` tag would be formatted as CSS. #3491 was marked as a duplicate of #1882, but #1882 is only about HTML, not XML. **Input:** ```svg <svg xmlns="http://www.w3.org/2000/svg" width="120" height="120"> <defs ><style>.foo {color: cyan}</style></defs> <rect fill="#e8e8e8" height="108" rx="12" width="108" x="0" y="4"></rect> </svg> ``` **Output:** N/A **Expected behaviour:** ```svg <svg xmlns="http://www.w3.org/2000/svg" width="120" height="120"> <defs> <style> .foo { color: cyan; } </style> </defs> <rect fill="#e8e8e8" height="108" rx="12" width="108" x="0" y="4" /> </svg> ```
Posted by remcohaszing on Nov 1, 2018, 10:06 AM
Tags
Related issues
- some bike vendor told me that the biggest problem with regular to ebike conversion was that regular bike frames were not strong enough to...
- I think of this as the kiosk economy.
- What a goofy comment.
- There's lots of evidence for positive influences of Caffeine on the body (some negative as well), especially the brain.
- Compose support in WSLc
- [RFC] Roadmap to v2.0
Raise real-world problems, find people facing the same issue, and discuss solutions.4,000 issues0 comments
support (Other)
some bike vendor told me that the biggest problem with regular to ebike conversion was that regular bike frames were not strong enough to...
I think of this as the kiosk economy.
What a goofy comment.
There's lots of evidence for positive influences of Caffeine on the body (some negative as well), especially the brain.
Compose support in WSLc
[RFC] Roadmap to v2.0
[Feature]: Add TurboQuant Support for KV Cache Quantization
Support for AGENTS.md and .agents/skills/, the community has been asking since August 2025
Support for XML / SVG
It would be great if prettier could also check and format XML and SVG files. The formatting rules would be exactly the same as for JSX. Specificly for SVG, the contents of a `<style />` tag would be formatted as CSS. #3491 was marked as a duplicate of #1882, but #1882 is only about HTML, not XML. **Input:** ```svg <svg xmlns="http://www.w3.org/2000/svg" width="120" height="120"> <defs ><style>.foo {color: cyan}</style></defs> <rect fill="#e8e8e8" height="108" rx="12" width="108" x="0" y="4"></rect> </svg> ``` **Output:** N/A **Expected behaviour:** ```svg <svg xmlns="http://www.w3.org/2000/svg" width="120" height="120"> <defs> <style> .foo { color: cyan; } </style> </defs> <rect fill="#e8e8e8" height="108" rx="12" width="108" x="0" y="4" /> </svg> ```
Comments (0)
No comments yet. Start the discussion.