// Copyright 2024 The Gitea Authors. All rights reserved. // SPDX-License-Identifier: MIT package markup_test import ( "context" "html/template" "strings" "testing" "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/markup" "code.gitea.io/gitea/modules/markup/markdown" "github.com/stretchr/testify/assert" ) func TestRenderCodePreview(t *testing.T) { markup.Init(&markup.ProcessorHelper{ RenderRepoFileCodePreview: func(ctx context.Context, opts markup.RenderCodePreviewOptions) (template.HTML, error) { return "
http://other/owner/repo/src/commit/0123456789/foo/bar.md#L10-L20
`) }