From 55c0cdfd7d8f256de04a8ef26211a52c9bd2aa20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Sat, 5 Mar 2022 12:15:22 +0100 Subject: [PATCH] Fix version / branch in relative links (#566) --- src/tools/markdown/markdown.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tools/markdown/markdown.ts b/src/tools/markdown/markdown.ts index ac0ebe69..79321da2 100644 --- a/src/tools/markdown/markdown.ts +++ b/src/tools/markdown/markdown.ts @@ -53,7 +53,12 @@ export class markdown { input = input.replace(/!\[*.*\]\((?!.*:\/\/).*\/*.*\.\w*\)/g, function (x) { return x .replace("(/", "(") - .replace("(", `(https://raw.githubusercontent.com/${repo?.full_name}/master/`) + .replace( + "(", + `(https://raw.githubusercontent.com/${repo.full_name}/${ + repo.available_version || repo.default_branch + }/` + ) .replace("/blob/", "/"); }); }