# v2.1.2

> SVG files can be kept as written, Illustrator exports parse, and preserved SVG text keeps its spaces.

## 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](/docs/ignore/). ([#33](https://github.com/lukeed/tidy/pull/33))

  ```xml
  <!-- 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. See [`xml-ignore-next-node`](https://github.com/lukeed/tidy/blob/main/docs/deviations.md#xml-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 with `Unexpected character`. ([#33](https://github.com/lukeed/tidy/pull/33))

  ```xml
  <!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`](https://github.com/lukeed/tidy/blob/main/docs/deviations.md#xml-doctype-internal-subset).

- **HTML** & **Vue** print an SVG `<text>` under `xml:space="preserve"` the way a `<pre>` prints. Prettier collapses its whitespace, and that changes what renders 🙃 The `preserve` can be on the `<text>` or on any SVG element around it, and a nearer `default` doesn't end it. This matches Firefox, which is less strict than Chrome. `xml:space` on HTML elements doesn't render, so tidy still formats those. ([#33](https://github.com/lukeed/tidy/pull/33))

  > **Note:** This is a new deviation from Prettier. See [`html-svg-text-xml-space-preserve`](https://github.com/lukeed/tidy/blob/main/docs/deviations.md#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](https://github.com/lukeed/tidy/pull/33))

## Chore

- CI pins mise & installs only the tools each job runs, so a lint tool can't break a deploy or a release. ([d45d38a](https://github.com/lukeed/tidy/commit/d45d38a), [b04a94f](https://github.com/lukeed/tidy/commit/b04a94f))
