Skip to content

Commit 48237ab

Browse files
committed
fix(withFragment): use encodeHash for encoding
1 parent 9013029 commit 48237ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ export function isEqual(a: string, b: string, options: CompareURLOptions = {}) {
301301

302302
export function withFragment(input: string, hash: string): string {
303303
const parsed = parseURL(input);
304-
parsed.hash = hash === "" ? "" : "#" + encodeURI(hash);
304+
parsed.hash = hash === "" ? "" : "#" + encodeHash(hash);
305305
return stringifyParsedURL(parsed);
306306
}
307307

0 commit comments

Comments
 (0)