c572fcfe04
Rename the Go module path from code.gitea.io/gitea to git.mokoconsulting.tech/MokoConsulting/MokoGitea across the entire codebase. Scope: - go.mod module declaration - 2,235 Go source files (import paths) - Dockerfile WORKDIR and COPY paths - Swagger API templates - golangci.yml linter config External dependencies (code.gitea.io/gitea-vet, code.gitea.io/sdk/gitea, gitea.com/gitea/act, etc.) are intentionally NOT renamed — they are separate upstream modules. Closes #132 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
40 lines
1.2 KiB
Go
40 lines
1.2 KiB
Go
// Copyright 2024 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package renderhelper
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"git.mokoconsulting.tech/MokoConsulting/MokoGitea/models/unittest"
|
|
"git.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/markup"
|
|
"git.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/markup/markdown"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestSimpleDocument(t *testing.T) {
|
|
unittest.PrepareTestEnv(t)
|
|
rctx := NewRenderContextSimpleDocument(t.Context(), "/base").WithMarkupType(markdown.MarkupName)
|
|
rendered, err := markup.RenderString(rctx, `
|
|
65f1bf27bc3bf70f64657658635e66094edbcb4d
|
|
#1
|
|
@user2
|
|
|
|
[/test](/test)
|
|
[./test](./test)
|
|

|
|

|
|
`)
|
|
assert.NoError(t, err)
|
|
assert.Equal(t,
|
|
`<p>65f1bf27bc3bf70f64657658635e66094edbcb4d
|
|
#1
|
|
<a href="/user2" rel="nofollow">@user2</a></p>
|
|
<p><a href="/base/test" rel="nofollow">/test</a>
|
|
<a href="/base/test" rel="nofollow">./test</a>
|
|
<a href="/base/image" target="_blank" rel="nofollow noopener"><img src="/base/image" alt="/image"/></a>
|
|
<a href="/base/image" target="_blank" rel="nofollow noopener"><img src="/base/image" alt="./image"/></a></p>
|
|
`, rendered)
|
|
}
|