Closed Perlkonig closed 1 year ago
.use()
calls .attr('href', ...
, and it's a sanity check in attr()
that expands any hex-color-like value to the full hex color, thus an invalid href
id.
Gnaaa I hate to make exceptions in that regard. Maybe I should define attributes that are designed to take colors and only test for those
Took a while for me to fix but here you go :)
I am sorry, I somehow forgot to publish all the fixes I made. I just released it: https://github.com/svgdotjs/svg.js/releases/tag/3.2.1
Bug report
use()
is apparently converting IDs that it thinks are shortened hexadecimal colour strings.Fiddle
https://jsfiddle.net/krtwhuLb/3/
Explanation
If you look at the resulting SVG, you'll see that the
<use>
tag for#A20
got converted into<use xlink:href="#aa2200"></use>
, which of course doesn't exist indefs
and so the green circle doesn't display.