Refactor markup render system (#32589)
This PR mainly moves some code and introduces `RenderContext.WithXxx` functions
This commit is contained in:
parent
81ac8d914c
commit
c4e27cb27b
49 changed files with 486 additions and 626 deletions
|
@ -4,10 +4,10 @@
|
|||
package markup
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"code.gitea.io/gitea/modules/git"
|
||||
"code.gitea.io/gitea/modules/markup"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
@ -24,8 +24,7 @@ func TestRenderCSV(t *testing.T) {
|
|||
|
||||
for k, v := range kases {
|
||||
var buf strings.Builder
|
||||
err := render.Render(&markup.RenderContext{Ctx: git.DefaultContext},
|
||||
strings.NewReader(k), &buf)
|
||||
err := render.Render(markup.NewRenderContext(context.Background()), strings.NewReader(k), &buf)
|
||||
assert.NoError(t, err)
|
||||
assert.EqualValues(t, v, buf.String())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue