Use of Asset Export panel modifies existing SVG when closing without saving changes
When using the Asset Export panel in Illustrator, if an SVG is exported with the same name as the currently open file, when that file is closed without saving changes, the existing file is modified.
Specifically, a <metadata> element is added to the SVG, which results in unexpected behaviour when trying to use the SVG in an HTML document for example.
This is part of my current workflow because Illustrator creates better SVG exports than XD. Therefore I am exporting an SVG from XD, then opening it in, and re-exporting it from, Illustrator. Every time I repeat that process, I encounter this bug - normally when closing Illustrator at the end of the task.
Steps to reproduce:
- Create a new document (it can be any size). I have created a 50px by 50px Web document.
- Add an object to that document. I have added a black square 50px by 50px with no stroke. [Screenshot 'Step 2']
- Drag that object into the Asset Export panel. Leave the name as the default of Asset 1.
- Export the asset as an SVG.
- Open the exported SVG in a text editor to see it's code. [Screenshot 'Step 5']
- Close the document created in step 1.
- Open the new 'Asset 1.svg' in Illustrator.
- Drag the object (in this case the black square) to the Asset Export panel again. Leave the name as the default of Asset 1.
- Export the asset as an SVG. When asked if you want to replace the existing file choose to replace.
- Open the exported SVG (from step 9) in a text editor and observe that the code is different to the output from step 5. [Screenshot 'Step 10']
- Close the open document in Illustrator. When asked to save changes, choose 'Don't Save'.
- Open the exported SVG (from step 9) in a text editor and observe that the <metadata> element has been added, despite choosing to not save changes. [Screenshot 'Step 12']
Adobe Illustrator CC v22.1
Running on macOS High Sierra v10.13.6