Skip to content

Commit

Permalink
fix: edit on github urls
Browse files Browse the repository at this point in the history
  • Loading branch information
nickfrosty committed Sep 13, 2024
1 parent 3b5d821 commit 7b1d053
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils/contentApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,9 @@ export default class ContentApi {
if (!filePath) return repoUrl;
else if (!filePath.startsWith("/")) filePath = `/${filePath}`;

return new URL(`${repoUrl}/tree/main${filePath}`).toString();
const url = new URL(`${repoUrl}/blob/main${filePath}`);
url.searchParams.set("plain", "1");
return url.toString();
}

/**
Expand Down

0 comments on commit 7b1d053

Please sign in to comment.