prime8dev

prime8dev
git clone https://git.prime8.dev/prime8dev.git
Log | Files | Refs | README | LICENSE

commit 83b9b2802595ce8826006b7628d8fbd24a08f1eb
parent 4d8d7080bf477710eb34bad61b56b1124998584d
Author: Damian Myrda <damian@prime8.dev>
Date:   Sat, 31 Jan 2026 19:08:11 -0600

fix(git): handle relative links without ./ prefix

Now converts both ./LICENSE and LICENSE style links to full blob URLs.

Diffstat:
Msrc/external/git.ts | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/external/git.ts b/src/external/git.ts @@ -64,14 +64,14 @@ function fixRelativePaths(urls: RepoUrls, markdown: string): string { // blob = file browser URL (for links) const blob = `${urls.web}/-/blob/${urls.branch}`; markdown = markdown.replace( - /(?<!!)\[([^\]]+)\]\(\.\/([^)]+)\)/g, + /(?<!!)\[([^\]]+)\]\((?!https?:\/\/)([^)]+)\)/g, `[$1](${blob}/$2)`, ); // raw = direct file content URL (for images) const raw = `${urls.web}/-/raw/${urls.branch}`; markdown = markdown.replace( - /!\[([^\]]*)\]\(\.\/([^)]+)\)/g, + /!\[([^\]]*)\]\((?!https?:\/\/)([^)]+)\)/g, `![$1](${raw}/$2)`, );