Support for XML / SVG
See original GitHub issueIt 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 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 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>
Issue Analytics
- State:
- Created 5 years ago
- Reactions:134
- Comments:21 (10 by maintainers)
Top Results From Across the Web
SVG, graphics in XML for the Web - Xul.fr
SVG, Scalable Vector Graphic, is a specification of documents to describe scalable 2D graphics in XML. It is compatible with XML 1.0.
Read more >xml:space - SVG: Scalable Vector Graphics - MDN Web Docs
SVG supports the built-in XML xml:space attribute to handle whitespace characters inside elements. Child elements inside an element may also ...
Read more >Introduction — SVG 2 - W3C
SVG is a language for describing two-dimensional graphics. As a standalone format or when mixed with other XML, it uses the XML syntax...
Read more >Editing SVG Files - Oxygen XML Editor
Oxygen XML Editor uses the Apache Batik open source library to render SVG images and it only has partial support for SVG 1.2....
Read more >HTML SVG Graphics - W3Schools
SVG defines vector-based graphics in XML format. What is SVG? SVG stands for Scalable Vector Graphics; SVG is used to define graphics for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Opened the PR!
any progress?