From c4e27cb27b99dd9528c999fdc8b1073f28be6313 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Fri, 22 Nov 2024 13:48:09 +0800 Subject: Refactor markup render system (#32589) This PR mainly moves some code and introduces `RenderContext.WithXxx` functions --- routers/api/v1/misc/markup.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'routers/api/v1') diff --git a/routers/api/v1/misc/markup.go b/routers/api/v1/misc/markup.go index 868ed92519..7b3633552f 100644 --- a/routers/api/v1/misc/markup.go +++ b/routers/api/v1/misc/markup.go @@ -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 } -- cgit v1.2.3