Skip to content

Commit

Permalink
fix(withFragment): use encodeHash for encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Feb 5, 2024
1 parent 9013029 commit 48237ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.ts
Expand Up @@ -301,7 +301,7 @@ export function isEqual(a: string, b: string, options: CompareURLOptions = {}) {

export function withFragment(input: string, hash: string): string {
const parsed = parseURL(input);
parsed.hash = hash === "" ? "" : "#" + encodeURI(hash);
parsed.hash = hash === "" ? "" : "#" + encodeHash(hash);
return stringifyParsedURL(parsed);
}

Expand Down

0 comments on commit 48237ab

Please sign in to comment.