mirror of
https://github.com/go-gitea/gitea.git
synced 2026-02-07 09:49:41 +09:00
fix: generate IDs for HTML headings without id attribute (#36233)
This PR fixes #27383 where HTML headings like `<h1>Title</h1>` in markdown files would have empty permalink anchors --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
committed by
GitHub
parent
1d01286f4c
commit
f9d3983de2
@@ -70,6 +70,6 @@ func NewRenderContextRepoFile(ctx context.Context, repo *repo_model.Repository,
|
||||
"repo": helper.opts.DeprecatedRepoName,
|
||||
})
|
||||
}
|
||||
rctx = rctx.WithHelper(helper)
|
||||
rctx = rctx.WithHelper(helper).WithEnableHeadingIDGeneration(true)
|
||||
return rctx
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ func NewRenderContextRepoWiki(ctx context.Context, repo *repo_model.Repository,
|
||||
"markupAllowShortIssuePattern": "true",
|
||||
})
|
||||
}
|
||||
rctx = rctx.WithHelper(helper)
|
||||
rctx = rctx.WithHelper(helper).WithEnableHeadingIDGeneration(true)
|
||||
helper.ctx = rctx
|
||||
return rctx
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user