Refactor markup render system (#32645)

This PR mainly removes some global variables, moves some code and
renames some functions to make code clearer.

This PR also removes a testing-only option ForceHardLineBreak during
refactoring since the behavior is clear now.
This commit is contained in:
wxiaoguang 2024-11-27 00:46:02 +08:00 committed by GitHub
parent 87bb5ed0bc
commit b6ce2d6dc9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 188 additions and 225 deletions

View file

@ -27,6 +27,6 @@ func FuzzMarkdownRenderRaw(f *testing.F) {
func FuzzMarkupPostProcess(f *testing.F) {
f.Fuzz(func(t *testing.T, data []byte) {
setting.AppURL = "http://localhost:3000/"
markup.PostProcess(newFuzzRenderContext(), bytes.NewReader(data), io.Discard)
markup.PostProcessDefault(newFuzzRenderContext(), bytes.NewReader(data), io.Discard)
})
}