Skip to content

Commit

Permalink
fix: avoid normalising paths with app routing hashes
Browse files Browse the repository at this point in the history
Fixes #257
  • Loading branch information
harlan-zw committed Jan 1, 2025
1 parent 05753be commit c28fcc7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/core/src/router/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ export function normaliseRoute(url: string): NormalisedRoute {
}

const $url = new URL(url)
const hash = $url.hash.startsWith('#/') ? $url.hash : ''
// make sure we start with a leading slash
const path = `${withLeadingSlash($url.pathname)}${$url.search}`
const path = `${withLeadingSlash($url.pathname)}${hash}${$url.search}`

let normalised: Partial<NormalisedRoute> = {
id: hashPathName(`${$url.pathname}${$url.search}`),
id: hashPathName(path),
url,
$url,
path,
Expand Down

0 comments on commit c28fcc7

Please sign in to comment.