Skip to main content
Question

Invalid ID attribute when exporting as an SVG


Hey 👋

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

This topic has been closed for replies.

3 replies

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.


Simon_Widjaja

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…


Brian_Olson
  • New Participant
  • 17 replies
  • October 23, 2024

This causes roadblocks for our company too. Please fix.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings