mirror of
https://github.com/go-gitea/gitea
synced 2025-07-05 18:17:19 +00:00
Refactor markup render system (#32589)
This PR mainly moves some code and introduces `RenderContext.WithXxx` functions
This commit is contained in:
@ -7,7 +7,7 @@ import (
|
||||
"bytes"
|
||||
stdcsv "encoding/csv"
|
||||
"io"
|
||||
"path/filepath"
|
||||
"path"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
@ -53,7 +53,7 @@ func CreateReaderAndDetermineDelimiter(ctx *markup.RenderContext, rd io.Reader)
|
||||
func determineDelimiter(ctx *markup.RenderContext, data []byte) rune {
|
||||
extension := ".csv"
|
||||
if ctx != nil {
|
||||
extension = strings.ToLower(filepath.Ext(ctx.RelativePath))
|
||||
extension = strings.ToLower(path.Ext(ctx.RenderOptions.RelativePath))
|
||||
}
|
||||
|
||||
var delimiter rune
|
||||
|
Reference in New Issue
Block a user