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:
@@ -41,13 +41,10 @@ func showUserFeed(ctx *context.Context, formatType string) {
|
||||
return
|
||||
}
|
||||
|
||||
ctxUserDescription, err := markdown.RenderString(&markup.RenderContext{
|
||||
Ctx: ctx,
|
||||
Links: markup.Links{
|
||||
Base: ctx.ContextUser.HTMLURL(),
|
||||
},
|
||||
Metas: markup.ComposeSimpleDocumentMetas(),
|
||||
}, ctx.ContextUser.Description)
|
||||
ctxUserDescription, err := markdown.RenderString(markup.NewRenderContext(ctx).
|
||||
WithLinks(markup.Links{Base: ctx.ContextUser.HTMLURL()}).
|
||||
WithMetas(markup.ComposeSimpleDocumentMetas()),
|
||||
ctx.ContextUser.Description)
|
||||
if err != nil {
|
||||
ctx.ServerError("RenderString", err)
|
||||
return
|
||||
|
Reference in New Issue
Block a user