You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using svgdom for a project, and it's doing an awesome job. So far, it has helped us generate over 4000 SVG files which are then exported to PNG using Inkscape.
We had one issue though. Namespaced (xlink) attributes are rendered without the namespace. I've now fixed this in Crystal on the server side:
privatedeffix_svg_xlink_attributes(svg)
svg.gsub(/ href="#/, %( xlink:href="#))
end
But it's not an ideal situation.
I'm just calling outerHTML on the generated SVG element. Maybe I'm missing something?
The text was updated successfully, but these errors were encountered:
Mh, usually attributes should contain the name space if there were created with such.
Is it only happen with xlink or are other namespaces affected as well?
The namespace part is not the easiest part of the Dom spec to understand tbh so it's very well possible that there is a bug in the implementation :D
That's the only namespace we use, so I'm not sure if it also affects others. We're not using SVG.js btw, just a micro SVG lib. It's using setAttributeNS on the elements in question. Calling outerHTML in the browser and saving that to a file does work. So something's not right there.
I can give you access to the repo if you want. It's a simple internal Node app with three endpoints each returning an SVG.
I'm using svgdom for a project, and it's doing an awesome job. So far, it has helped us generate over 4000 SVG files which are then exported to PNG using Inkscape.
We had one issue though. Namespaced (
xlink
) attributes are rendered without the namespace. I've now fixed this in Crystal on the server side:But it's not an ideal situation.
I'm just calling outerHTML on the generated SVG element. Maybe I'm missing something?
The text was updated successfully, but these errors were encountered: