Turns out, links can be not only HTMLAnchorElement but also SVGAElement if they're rendered inside an svg tag.
If you do SVGAElement.href you won't get a string but rather an instance of SVGAnimatedString object. The library currently doesn't expect that hence navigating via svg links throws an error.
I implemented a check that if a property of a link returns SVGAnimatedString then we return .baseVal of it to get the correct value.
Turns out, links can be not only
HTMLAnchorElement
but alsoSVGAElement
if they're rendered inside ansvg
tag.If you do
SVGAElement.href
you won't get a string but rather an instance ofSVGAnimatedString
object. The library currently doesn't expect that hence navigating via svg links throws an error.I implemented a check that if a property of a link returns
SVGAnimatedString
then we return.baseVal
of it to get the correct value.Moreover, svg's
href
property doesn't convert relative urls to absolute ones so i implemented this conversion as well. (i stole some code from next.js https://github.com/vercel/next.js/blob/24b2ff16abaa973d695247a9c1ac4e229640d4ca/packages/next/src/client/link.tsx#L743)