kibu-australia / pushy

Clojurescript library for quick and easy HTML5 pushState
Eclipse Public License 1.0
223 stars 28 forks source link

Support anchors in SVG #23

Closed magnars closed 7 years ago

magnars commented 7 years ago

The href attribute of SVG anchor elements are not strings, but SVGAnimatedString with a .baseVal string attribute.

Without this fix, pushy creates URLs like these:

http://localhost:8090/foo/[object%20SVGAnimatedString]

With the fix, pushy handles anchors in SVGs like a champ.

wavejumper commented 7 years ago

Thanks @magnars!

magnars commented 7 years ago

Hey @wavejumper! Did you mean to merge this in? :)

magnars commented 7 years ago

Turns out this PR also needs SVGAnimatedString to be added to the externs, since Google Closure doesn't know about it. How would you go about adding externs to a library like this? I've only ever done it when I have access to the build definition in my projects.