Replace xlink:href with href attribute on <use> elements
duff92 opened this issue · comments
Is your feature request related to a problem? Please describe.
According to MDN web docs the xlink:href
attribute is deprecated since SVG 2. See documentation here: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/xlink:href
The xlink:href
is used as an attribute to <use>
element in multiple places when rendering nodes but also as a CSS selector when calculating the edges.
Describe the solution you'd like
Instead of using xlink:href
only the href
attribute should be used according to de documentation to reference symbols.
Describe alternatives you've considered
No alternative solutions have been considered yet, mainly because this is the solution presented from the MDN web docs. https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/href
Additional context
Most likely xlink:href will be supported in most browsers, therefore this is not critical yet.
Thank you for creating this issue. I am working on updating that code right now, so I will investigate this issue as well.
Perfect, thanks @ajbogh! Let me know if you need any help in reviewing or addition 👍🏻
Please be aware that the new code still allows xlink:href, but it by default uses href. I couldn't add a deprecation warning because it would have console.warned on every node, potentially filling up the console. I have to admit that it made me laugh at how much it wanted me to change the xlink:hrefs though.