jrbenson / dynamic-vector-graphics

This project provides a system that uses annotations on provided data and SVG file to create a dynamic vector graphic.
MIT License
4 stars 0 forks source link

Protect IDs Within Loaded SVG from Duplication Conflicts #2

Open jrbenson opened 3 years ago

jrbenson commented 3 years ago

Currently when SVGs are loaded into the web page directly by the DVG library there is no protection against duplicate IDs in multiple SVG files. This is an issue if the user wants to include the same illustration more than once or often just because illustration tools tend to have standard id generation algorithms and so exports tend to have similar naming patterns, like "mask1", "mask2", etc. The workaround for this currently is to place each SVG into an iframe, but that is not ideal.

It would be better to take an approach similar to what svg-inject does with ids, perhaps even to use the id altering portion of their project if possible.