Editing wiki pages in VS code ; bogus image paths

When attaching images in a wiki page using the web interface

  • images are saved in the uploads folder
  • the wiki page that references the image has a tag in the following form after the upload:
![Image1](uploads/<unique image id>/Image1.png)

As a result, wiki pages as seen in eg. Visual Studio Code cannot display the images since this relative is always wrong, except for the home wiki page (all wiki pages are children of the home page, making the uploads/ relative path wrong).

Somehow the Gitlab web interface always recognizes the uploads path and displays the image appropriately - which VS Code doesn’t.

Now, I have noticed that changing the path to the correct relative path, that is, using the following (correct) relative URL :

![Image1](../uploads/<unique image id>/Image1.png)

seems to work, too. Both the Gitlab web interface and VS code are happy with this.

I would like to know if this is safe to do this and update all the URLs for all my wiki pages.

My use case is simple: I have multiple wiki repositories and using VS code to search for wiki text across all repositories is very useful.

I’m using Gitlab 16.0.4.