Fix rendered wiki page link (#31398) (#31407)

Backport #31398

Fix #31395
This commit is contained in:
wxiaoguang 2024-06-19 11:23:24 +08:00 committed by GitHub
parent e8e43a7ee4
commit 042e9fcd81
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 62 additions and 78 deletions

View file

@ -442,6 +442,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>`,