mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Refactor markup render system (#32589)
This PR mainly moves some code and introduces `RenderContext.WithXxx` functions
This commit is contained in:
@@ -288,13 +288,9 @@ func renderViewPage(ctx *context.Context) (*git.Repository, *git.TreeEntry) {
|
||||
footerContent = data
|
||||
}
|
||||
|
||||
rctx := &markup.RenderContext{
|
||||
Ctx: ctx,
|
||||
Metas: ctx.Repo.Repository.ComposeWikiMetas(ctx),
|
||||
Links: markup.Links{
|
||||
Base: ctx.Repo.RepoLink,
|
||||
},
|
||||
}
|
||||
rctx := markup.NewRenderContext(ctx).
|
||||
WithMetas(ctx.Repo.Repository.ComposeWikiMetas(ctx)).
|
||||
WithLinks(markup.Links{Base: ctx.Repo.RepoLink})
|
||||
buf := &strings.Builder{}
|
||||
|
||||
renderFn := func(data []byte) (escaped *charset.EscapeStatus, output string, err error) {
|
||||
|
Reference in New Issue
Block a user