visionmedia / page.js

Micro client-side router inspired by the Express router
http://visionmedia.github.com/page.js
7.67k stars 687 forks source link

Hashbang links in SVG (via xlink:href) add an additional hashbang in URL #532

Open thom4parisot opened 5 years ago

thom4parisot commented 5 years ago

Hello,

Thanks for maintaining this project. I read #391 and assumed clicking on SVG links is handled by page.

I use page with hashbang:true as an option within a single page app. The following code will redirect to #!/#!/test instead of #!/test:

<svg viewBox="0 0 400 400" xmlns:xlink="http://www.w3.org/1999/xlink">
  <a xlink:href="#!/test">Test</a>
</svg>

It looks like the URL is understood as /#!/finance-details/M52-DF-02.

If I try with xlink:href="./#!/test", page redirects me to #!/./#!/test.

👁 https://jsfiddle.net/o034ukef/1/