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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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>`,