don't encode unicode characters in links #762
Massimo Melina committed
Oct 5, 2024 at 15:08 UTC
5b4997e96a6995072694ebd061d0e16ca88b5122
1 file changed
+1
-1
src/cross.ts
+1
-1
@@ -401,7 +401,7 @@ export async function promiseBestEffort<T>(promises: Promise<T>[]) {
401
402
// encode paths leaving / separator unencoded (not like encodeURIComponent), but still encode #
403
export function pathEncode(s: string) {
404
- return encodeURI(s).replace(/#/g, encodeURIComponent)
404
+ return s.replace(/[#'"% ?\\]/g, encodeURIComponent)
405
}
406
//unused function pathDecode(s: string) { return decodeURI(s).replace(/%23/g, '#') }
407