Fixes
-
XML keeps the next node as written after
<!-- prettier-ignore -->. Before the root element, it keeps the whole file. So a generated SVG (pixel art, icon sprites, exported diagrams) can finally stay the way it was written, instead of being reflowed to one shape per line. See Ignoring code. (#33)<!-- prettier-ignore --> <svg xmlns="http://www.w3.org/2000/svg"><g><rect/><rect/></g></svg>Note: This is a new deviation from
@prettier/plugin-xml, which supports only ranges inside an element. Seexml-ignore-next-node. -
XML accepts a DOCTYPE internal subset (
[ <!ENTITY …> ]), as Illustrator writes it, and prints it as written. Before, an exported SVG like this stopped withUnexpected character. (#33)<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "svg11.dtd" [ <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/"> ]>Note: The plugin rejects these files. See
xml-doctype-internal-subset. -
HTML & Vue print an SVG
<text>underxml:space="preserve"the way a<pre>prints. Prettier collapses its whitespace, and that changes what renders 🙃 Thepreservecan be on the<text>or on any SVG element around it, and a nearerdefaultdoesn't end it. This matches Firefox, which is less strict than Chrome.xml:spaceon HTML elements doesn't render, so tidy still formats those. (#33)Note: This is a new deviation from Prettier. See
html-svg-text-xml-space-preserve. -
Tempura breaks an element's attributes before the
{{ value }}inside them. Before, a value broke inside its braces first, even when its code couldn't break. Now a value whose code fits on its line never breaks, like a Handlebars mustache. Other code goes on lines of its own, and a lone value child hugs its tag without a second indent. This bug was in 2.0.0, 2.1.0 & 2.1.1. (#33)