Wiki-only projects do not display URLs of an asciidoc link properly

Summary

Wiki-only projects do not display URLs of an asciidoc link properly when the wiki is used as the project landing page.

Steps to reproduce

  1. Create a project
  2. Disable repository feature, enable wiki feature
  3. Add a link “link:some/other/page[some page]” to Wiki home (make sure to use asciidoc mode).
  4. Verify after saving you can click that link and populate text of new page.
  5. Go back to wiki and verify that the link now takes you to the new page you just saved, note url to page
  6. Go to top of project (the project landing page
  7. Notice how the url is incorrect

Example Project

https://gitlab.com/tpresa/test-wiki

What is the current bug behavior?

Link in the project's landing page points to https://gitlab.com/tpresa/some/other/page

What is the expected correct behavior?

It should point to https://gitlab.com/tpresa/test-wiki/-/wikis/some/other/page

Output of checks

This bug happens on gitlab.com

ZD https://gitlab.zendesk.com/agent/tickets/170409

cc @jrreid @cdybenko @mnohr

Edited by Luke Duncalfe