Skip to content

Fix view wiki pages that contain empty spaces in their file names

What does this MR do and why?

It allows GitLab Wiki to open files that contain spaces in their names instead of redirecting to the creation page.

It fixes this issue #391264 (closed).

To do so, some changes were applied:

  • When listing or finding wiki pages, the returned page path is the raw path and no more a forced sluggified version of it. Doing so we can show, edit and delete pages that contain spaces in their names.

When creating or editing wiki pages, I kept the logic that sluggify the page title to use it as the page path.

Screenshots or screen recordings

When browsing through wiki pages Comments
LIsting We can access all pages. Take a look at the browser URL.
When editing the content of a wiki page whose original path does not contain spaces Comments
Recording_2023-12-07_at_23.03.03 We can update the page content and the original page path does not change.
When editing the content of a wiki page whose original path containa spaces Comments
3 We can update the page content and the original page path changes to a sluggified version.
When editing the content of a wiki page whose original path does not contain spaces and there is another page with the same name but with the original path with spaces Comments
4 Here, I edited the Page 1 whose original path is Page-1.md.
In the repository exists another page Page 1 but with the original path with spaces (Page 1.md).
The logic to update a page with a slugggified path is not affected if there is another page with the same name but with a non-slugggified path.
When editing the content of a wiki page whose original path contains spaces and there is another page with the same name but with the original path sluggified Comments
5 Here, I edited the Page 1 whose original path is Page 1.md.
In the repository exists another page Page 1 but with the original path sluggified (Page-1.md).
The logic to update a page with a non-slugggified path is affected if there is another page with the same name but with a slugggified path.
This logic forces the user to rename the page title or to use pages with sluggified paths.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #391264 (closed)

Edited by Dannyel Cardoso da Fonseca

Merge request reports