diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2024-11-22 13:48:09 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-22 05:48:09 +0000 |
commit | c4e27cb27b99dd9528c999fdc8b1073f28be6313 (patch) | |
tree | bbd065423fa48e09553918d23bdc7c5daef6e8bd /routers/web/shared | |
parent | 81ac8d914cf5fdfaad3c206223ad0ace1e8c1dcd (diff) | |
download | gitea-c4e27cb27b99dd9528c999fdc8b1073f28be6313.tar.gz gitea-c4e27cb27b99dd9528c999fdc8b1073f28be6313.zip |
Refactor markup render system (#32589)
This PR mainly moves some code and introduces `RenderContext.WithXxx`
functions
Diffstat (limited to 'routers/web/shared')
-rw-r--r-- | routers/web/shared/user/header.go | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/routers/web/shared/user/header.go b/routers/web/shared/user/header.go index 9467b0986b..4cb0592b4b 100644 --- a/routers/web/shared/user/header.go +++ b/routers/web/shared/user/header.go @@ -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 |