Invalid ID attribute when exporting as an SVG

Hey :wave:

When using the GET image endpoint to export an SVG, if you set the svg_include_id param to true the ID attribute may include whitespace if your node name has whitespace.

This is invalid - Document Structure β€” SVG 2

I think this issue is probably slightly broader than I initially described

Valid XML 1.0 names only include designated characters (letters, digits, and a few punctuation marks), and do not start with a digit, a full stop (.) character, or a hyphen-minus (-) character.

I think node names are mostly pulled through as is so there are probably a few more instances when translating the name of a node β†’ an id attribute on an SVG are wrong.

I agree with Toby here. This is critical for my workflow and unfortunately an actual roadblock. Also related to this: I would like to be able to add classes to the SVG. It would be nice to be able to just copy/paste or export valid SVG with classes from Figma without any plugins…

This causes roadblocks for our company too. Please fix.