1
1
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:
wxiaoguang
2024-11-22 13:48:09 +08:00
committed by GitHub
parent 81ac8d914c
commit c4e27cb27b
49 changed files with 486 additions and 626 deletions

View File

@@ -49,10 +49,7 @@ func PrepareContextForProfileBigAvatar(ctx *context.Context) {
}
ctx.Data["OpenIDs"] = openIDs
if len(ctx.ContextUser.Description) != 0 {
content, err := markdown.RenderString(&markup.RenderContext{
Metas: markup.ComposeSimpleDocumentMetas(),
Ctx: ctx,
}, ctx.ContextUser.Description)
content, err := markdown.RenderString(markup.NewRenderContext(ctx).WithMetas(markup.ComposeSimpleDocumentMetas()), ctx.ContextUser.Description)
if err != nil {
ctx.ServerError("RenderString", err)
return