Skip to content

Commit

Permalink
Fix version / branch in relative links (#566)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus authored Mar 5, 2022
1 parent ccb1d4f commit 55c0cdf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/tools/markdown/markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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/", "/");
});
}
Expand Down

0 comments on commit 55c0cdf

Please sign in to comment.