1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-05 10:07:22 +00:00

Fix rendered wiki page link (#31398)

Fix #31395
This commit is contained in:
wxiaoguang
2024-06-18 11:09:20 +08:00
committed by GitHub
parent 37a4b233a0
commit 21783a5752
10 changed files with 58 additions and 73 deletions

View File

@ -444,6 +444,10 @@ func TestRender_ShortLinks(t *testing.T) {
"[[Link]]",
`<p><a href="`+url+`" rel="nofollow">Link</a></p>`,
`<p><a href="`+urlWiki+`" rel="nofollow">Link</a></p>`)
test(
"[[Link.-]]",
`<p><a href="http://localhost:3000/test-owner/test-repo/src/master/Link.-" rel="nofollow">Link.-</a></p>`,
`<p><a href="http://localhost:3000/test-owner/test-repo/wiki/Link.-" rel="nofollow">Link.-</a></p>`)
test(
"[[Link.jpg]]",
`<p><a href="`+imgurl+`" rel="nofollow"><img src="`+imgurl+`" title="Link.jpg" alt="Link.jpg"/></a></p>`,