Skip to content

Commit

Permalink
bugfix double url encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
FranciscoMoretti committed Oct 15, 2024
1 parent 5e7d276 commit 1b11362
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/weak-crabs-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"notion-downloader": patch
---

Fix double url encoding
7 changes: 6 additions & 1 deletion packages/notion-downloader/src/files/markdownPathUtils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
export function convertMarkdownPath(path: string): string {
const posixPath = path.replace(/\\/g, "/")
return encodeURI(posixPath)
// TODO: Ensure it's only encoded once by figuring out where the naming strategy gets applied in FilesManager get method
// IF not already url encoded, encode it
if (!posixPath.includes("%")) {
return encodeURI(posixPath)
}
return posixPath
}

0 comments on commit 1b11362

Please sign in to comment.