1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-14 14:37:20 +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

@ -99,9 +99,7 @@ func MarkdownRaw(ctx *context.APIContext) {
// "422":
// "$ref": "#/responses/validationError"
defer ctx.Req.Body.Close()
if err := markdown.RenderRaw(&markup.RenderContext{
Ctx: ctx,
}, ctx.Req.Body, ctx.Resp); err != nil {
if err := markdown.RenderRaw(markup.NewRenderContext(ctx), ctx.Req.Body, ctx.Resp); err != nil {
ctx.InternalServerError(err)
return
}