Fix issue title rendering and refactor legacy function names (#32703)

Fix #32700, regression of recent markup refactoring

And by the way, clarify many legacy problems:

1. Some "RenderXxx" functions do not really "render", they only call "post processors"
2. Merge "RenderEmoji | RenderCodeBlock", they are all for "simple issue title"
This commit is contained in:
wxiaoguang 2024-12-04 09:39:33 +08:00 committed by GitHub
parent 171edfc793
commit 2f43536c3e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 73 additions and 57 deletions

View file

@ -57,6 +57,9 @@ type RenderOptions struct {
type RenderContext struct {
ctx context.Context
// the context might be used by the "render" function, but it might also be used by "postProcess" function
usedByRender bool
SidebarTocNode ast.Node
RenderHelper RenderHelper
@ -182,6 +185,7 @@ func pipes() (io.ReadCloser, io.WriteCloser, func()) {
}
func render(ctx *RenderContext, renderer Renderer, input io.Reader, output io.Writer) error {
ctx.usedByRender = true
if ctx.RenderHelper != nil {
defer ctx.RenderHelper.CleanUp()
}