From 7b1d053bd4c6876b4a00662964b9b4026e95e712 Mon Sep 17 00:00:00 2001 From: nickfrosty <75431177+nickfrosty@users.noreply.github.com> Date: Fri, 13 Sep 2024 10:28:02 -0400 Subject: [PATCH] fix: edit on github urls --- src/utils/contentApi.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/contentApi.ts b/src/utils/contentApi.ts index 8ddce666..e18e84ae 100644 --- a/src/utils/contentApi.ts +++ b/src/utils/contentApi.ts @@ -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(); } /**