diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2024-11-22 13:48:09 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-22 05:48:09 +0000 |
commit | c4e27cb27b99dd9528c999fdc8b1073f28be6313 (patch) | |
tree | bbd065423fa48e09553918d23bdc7c5daef6e8bd /modules/markup/html_codepreview.go | |
parent | 81ac8d914cf5fdfaad3c206223ad0ace1e8c1dcd (diff) | |
download | gitea-c4e27cb27b99dd9528c999fdc8b1073f28be6313.tar.gz gitea-c4e27cb27b99dd9528c999fdc8b1073f28be6313.zip |
Refactor markup render system (#32589)
This PR mainly moves some code and introduces `RenderContext.WithXxx`
functions
Diffstat (limited to 'modules/markup/html_codepreview.go')
-rw-r--r-- | modules/markup/html_codepreview.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/markup/html_codepreview.go b/modules/markup/html_codepreview.go index 5c88481d76..68886a3434 100644 --- a/modules/markup/html_codepreview.go +++ b/modules/markup/html_codepreview.go @@ -38,7 +38,7 @@ func renderCodeBlock(ctx *RenderContext, node *html.Node) (urlPosStart, urlPosSt CommitID: node.Data[m[6]:m[7]], FilePath: node.Data[m[8]:m[9]], } - if !httplib.IsCurrentGiteaSiteURL(ctx.Ctx, opts.FullURL) { + if !httplib.IsCurrentGiteaSiteURL(ctx, opts.FullURL) { return 0, 0, "", nil } u, err := url.Parse(opts.FilePath) @@ -51,7 +51,7 @@ func renderCodeBlock(ctx *RenderContext, node *html.Node) (urlPosStart, urlPosSt lineStart, _ := strconv.Atoi(strings.TrimPrefix(lineStartStr, "L")) lineStop, _ := strconv.Atoi(strings.TrimPrefix(lineStopStr, "L")) opts.LineStart, opts.LineStop = lineStart, lineStop - h, err := DefaultProcessorHelper.RenderRepoFileCodePreview(ctx.Ctx, opts) + h, err := DefaultProcessorHelper.RenderRepoFileCodePreview(ctx, opts) return m[0], m[1], h, err } |