svgdotjs / svg.js

The lightweight library for manipulating and animating SVG
https://svgjs.dev
Other
11.04k stars 1.08k forks source link

When cloning, url(#someId) references are broken #1160

Closed phbernard closed 1 year ago

phbernard commented 3 years ago

In the image returned by mySvg.clone(), element IDs are rewritten, but references such as fill="url(#someId)" are not. Therefore, clone sometimes returns broken images.

JSFiddle to reproduce this issue: https://jsfiddle.net/pbernard/1o56prkb/52/

phbernard commented 3 years ago

Workaround PR: https://github.com/svgdotjs/svg.js/pull/1161