diff options
Diffstat (limited to 'routers/repo/release.go')
-rw-r--r-- | routers/repo/release.go | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/routers/repo/release.go b/routers/repo/release.go index 2ebb69b6ab..abce3e9ac1 100644 --- a/routers/repo/release.go +++ b/routers/repo/release.go @@ -15,6 +15,7 @@ import ( "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/convert" "code.gitea.io/gitea/modules/log" + "code.gitea.io/gitea/modules/markup" "code.gitea.io/gitea/modules/markup/markdown" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/upload" @@ -132,7 +133,14 @@ func releasesOrTags(ctx *context.Context, isTagList bool) { ctx.ServerError("calReleaseNumCommitsBehind", err) return } - r.Note = markdown.RenderString(r.Note, ctx.Repo.RepoLink, ctx.Repo.Repository.ComposeMetas()) + r.Note, err = markdown.RenderString(&markup.RenderContext{ + URLPrefix: ctx.Repo.RepoLink, + Metas: ctx.Repo.Repository.ComposeMetas(), + }, r.Note) + if err != nil { + ctx.ServerError("RenderString", err) + return + } } ctx.Data["Releases"] = releases @@ -182,7 +190,14 @@ func SingleRelease(ctx *context.Context) { ctx.ServerError("calReleaseNumCommitsBehind", err) return } - release.Note = markdown.RenderString(release.Note, ctx.Repo.RepoLink, ctx.Repo.Repository.ComposeMetas()) + release.Note, err = markdown.RenderString(&markup.RenderContext{ + URLPrefix: ctx.Repo.RepoLink, + Metas: ctx.Repo.Repository.ComposeMetas(), + }, release.Note) + if err != nil { + ctx.ServerError("RenderString", err) + return + } ctx.Data["Releases"] = []*models.Release{release} ctx.HTML(http.StatusOK, tplReleases) |