mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-01 20:32:11 +00:00
resolve relative path in markdown file
This commit is contained in:
parent
45a6444b1e
commit
4249cec68c
2 changed files with 70 additions and 23 deletions
|
@ -104,7 +104,11 @@ func Single(ctx *middleware.Context, params martini.Params) {
|
|||
} else if blob, err := readmeFile.LookupBlob(); err != nil {
|
||||
ctx.Data["FileIsLarge"] = true
|
||||
} else {
|
||||
ctx.Data["ReadmeContent"] = string(base.RenderMarkdown(blob.Contents()))
|
||||
// current repo branch link
|
||||
urlPrefix := "http://" + base.Domain + "/" + ctx.Repo.Owner.LowerName + "/" +
|
||||
ctx.Repo.Repository.Name + "/blob/" + params["branchname"]
|
||||
|
||||
ctx.Data["ReadmeContent"] = string(base.RenderMarkdown(blob.Contents(), urlPrefix))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue