Files
lotherk 1b490485ff refactor: import Gotea from Gitea v28.4.0
Rename the main module to gotea.dev and the binary to gotea, and update the application name and English locale. Keep the external gitea.dev/sdk and gitea.dev/actionslib module imports unchanged.

Assisted-by: OpenCode:DeepSeek-V4.1-Flash
2026-11-22 12:13:09 +00:00

25 lines
702 B
Go

// Copyright 2026 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package markup
import (
"strings"
"testing"
"gotea.dev/modules/test"
"github.com/stretchr/testify/assert"
)
func TestShortLinkProcessor(t *testing.T) {
test := func(input, expected string) {
sb := new(strings.Builder)
err := postProcess(NewTestRenderContext("/base"), []processor{shortLinkProcessor}, strings.NewReader(input), sb)
assert.NoError(t, err)
assert.Equal(t, test.NormalizeHTMLSpaces(expected), test.NormalizeHTMLSpaces(sb.String()))
}
test("[[name=foo|link=./link]]", `<a href="/base/link">foo</a>`)
test("[[name=foo|link=javascript:bar]]", `[[name=foo|link=javascript:bar]]`)
}