Do not render truncated links in markdown (#32980)

Fixes #31780
This commit is contained in:
wxiaoguang authored and GitHub committed 2024-12-26 00:33:55 +08:00
1 parent 5feb1a6bff
commit 594edad213
5 files changed
+40 -17

No files matched your search

+10
View File
@@ -206,6 +206,16 @@ func TestRender_links(t *testing.T) {
test(
"ftps://gitea.com",
`<p>ftps://gitea.com</p>`)
t.Run("LinkSplit", func(t *testing.T) {
input, _ := util.SplitStringAtByteN("http://10.1.2.3", 12)
assert.Equal(t, "http://10…", input)
test(input, "<p>http://10…</p>")
input, _ = util.SplitStringAtByteN("http://10.1.2.3", 13)
assert.Equal(t, "http://10.…", input)
test(input, "<p>http://10.…</p>")
})
}
func TestRender_email(t *testing.T) {