diff --git a/src/extension.ts b/src/extension.ts index 48eb524..61a1636 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -173,7 +173,11 @@ async function githubinator({ !!permalink || branchName == null ? createSha(head) : createBranch(branchName), - relativeFilePath: getRelativeFilePath(gitDir, fileName), + // escape invalid url characters + // See https://github.com/chdsbd/vscode-githubinator/issues/28 + relativeFilePath: encodeURIComponent( + getRelativeFilePath(gitDir, fileName), + ), }) if (parsedUrl != null) { console.log("Found provider", provider.name)