kibu-australia / pushy

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

Preserve fragments in URLs #25

Open magnars opened 7 years ago

magnars commented 7 years ago

When URLs have fragments in them, pushy used to discard them. This change preserves the fragment. Example:

<a href="/a-page#some-header">

Pushy would go to just /a-page before this change.

magnars commented 7 years ago

This turns out to not be a complete fix. The getToken function in the goog history API does not include the hash, so the initial dispatch does not include the hash. Hmfr.

magnars commented 7 years ago

Thankfully it wasn't goog.History that omitted the initial hash, so I was able to mend this easily enough. This PR is now good again. :)