mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-29 10:57:44 +09:00 
			
		
		
		
	Refactor markup render system (#32589)
This PR mainly moves some code and introduces `RenderContext.WithXxx` functions
This commit is contained in:
		| @@ -257,14 +257,11 @@ func Milestones(ctx *context.Context) { | ||||
| 			continue | ||||
| 		} | ||||
|  | ||||
| 		milestones[i].RenderedContent, err = markdown.RenderString(&markup.RenderContext{ | ||||
| 			Links: markup.Links{ | ||||
| 				Base: milestones[i].Repo.Link(), | ||||
| 			}, | ||||
| 			Metas: milestones[i].Repo.ComposeMetas(ctx), | ||||
| 			Ctx:   ctx, | ||||
| 			Repo:  milestones[i].Repo, | ||||
| 		}, milestones[i].Content) | ||||
| 		milestones[i].RenderedContent, err = markdown.RenderString(markup.NewRenderContext(ctx). | ||||
| 			WithLinks(markup.Links{Base: milestones[i].Repo.Link()}). | ||||
| 			WithMetas(milestones[i].Repo.ComposeMetas(ctx)). | ||||
| 			WithRepoFacade(milestones[i].Repo), | ||||
| 			milestones[i].Content) | ||||
| 		if err != nil { | ||||
| 			ctx.ServerError("RenderString", err) | ||||
| 			return | ||||
|   | ||||
		Reference in New Issue
	
	Block a user