mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-06-29 16:47:58 +08:00
Refactor markup render system (#32589)
This PR mainly moves some code and introduces `RenderContext.WithXxx` functions
This commit is contained in:
@ -5,13 +5,13 @@ package csv
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/csv"
|
||||
"io"
|
||||
"strconv"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"code.gitea.io/gitea/modules/git"
|
||||
"code.gitea.io/gitea/modules/markup"
|
||||
"code.gitea.io/gitea/modules/translation"
|
||||
|
||||
@ -231,10 +231,7 @@ John Doe john@doe.com This,note,had,a,lot,of,commas,to,test,delimiters`,
|
||||
}
|
||||
|
||||
for n, c := range cases {
|
||||
delimiter := determineDelimiter(&markup.RenderContext{
|
||||
Ctx: git.DefaultContext,
|
||||
RelativePath: c.filename,
|
||||
}, []byte(decodeSlashes(t, c.csv)))
|
||||
delimiter := determineDelimiter(markup.NewRenderContext(context.Background()).WithRelativePath(c.filename), []byte(decodeSlashes(t, c.csv)))
|
||||
assert.EqualValues(t, c.expectedDelimiter, delimiter, "case %d: delimiter should be equal, expected '%c' got '%c'", n, c.expectedDelimiter, delimiter)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user