[wiki] Can't add page to existing dir when dir has spaces in the name
Note: this issue is closely related to gitlab-ce#60316 and thus has similar text.
Summary
If you attempt to add a page to a directory with spaces in the name using the web ui it will instead create that page in a new directory with the same name (as the existing directory you want to add the page to) but in kabab-case. This behaviour is confusing and is unlikely to ever be what the user intends or wants.
It is possible because you can create directories with spaces when uploading via git but not using the web ui.
Steps To Reproduce
Clone wiki using git, create a directory with spaces in the name, add a page inside (empty directories are not visible in the web ui), push changes, using the web ui attempt to add a page to the same directory as the other page.
Example Project
https://gitlab.com/callumgare-ix/test-wiki/wikis/home
Possible fixes
Ideally how titles are reformated should probably rethought more generally. To the user the fact that a page can have hyphens but a directory can't when using the web ui is seemly arbitrary, confusing and annoying. Being able to create directories with spaces using git when you can't with the web ui only increases this. However that connects to a bigger issues which are covered by the likes gitlab-ce#57751 & &700.
The scope of this issue is specificity about gitlab not letting you add a page to a directory with spaces, even if that directory already exists with other pages in it and is displayed in the web ui. A possible fix is stopping the web ui convering dirs to kabab-case.