Ilustrator saving SVG missing data-name attribute in exported SVG
- August 1, 2024
- 3 replies
- 4356 views
In Illustrator 28.5 and above an SVG export longer is emitting the data-name attribute. It contained an exact copy of the text in the corresponding layer name.
The file ID43_V1.1.i.28.4.1.svg saved by Illustrator 28.4.1 and the file ID43_V1.1.i 28.6.svg was saved by Illustrator 28.6.
Line 54 in ID43_V1.1.i.28.4.1.svg has the line:
<rect id="center_top_leading:_235_pt" data-name="center, top, leading: 235 pt" class="cls-3" x="21.4361" y="1196.6758" width="1691.3774" height="217.0928"/>.
If you open the AI file ID43_V1.1.ai you will see a layer with the name: center, top, leading: 235 pt.
The corresponding line in the file ID43_V1.1.i 28.6.svg on line 31 looks like:
<rect id="center_x2C__top_x2C__leading:_235_pt_00000142166334487451118750000006251493092934391439_" x="21.4361" y="1196.6758" style="&st5;" width="1691.3773" height="217.0928"/>
This illustrates (pun intended) the difference between the different versions of Illustrator.
Our software relies on the data-name attribute being there and having the same text as the layer name. Is it possible to restore this functionality in the next release of Illustrator?
Our current workaround is to advise clients to use an earlier version before Illustrator 28.5. However, this will work in the short term but we need the backwards compatibility long term.
