Markdown links to .md file open the source instead of the rendered markdown
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Summary
When inserting a link to a .md file, for example link, clicking on it will open the source code, instead of opening the page. I don't know if this is intentional, I see little use cases for it.
The documentation currently shows examples with the .md extension even though it doesn't work as expected.
What I see however, is that it breaks at least one workflow: when using Visual Studio Code to edit markdown, if you link to a .md file you can ctrl+clic on it to open the file (or create it if missing). With the markdown-authoring extension it will also highlight broken links. Both these features won't work with regular gitlab links such as link, that is, without the .md extension.
Another example: github opens the interpreted markdown when clicking a .md link, which means porting github files to gitlab won't work.
This comment summarizes the issue pretty well: #17845 (comment 214980983)
Steps to reproduce
- Create a wiki page
- Add for example a relative link to another page link
- Create the other-page.md file and write some markdown in it
- Navigate to your first page and click the link
What is the current bug behavior?
The source code of other-page.md appears
What is the expected correct behavior?
You should be directed to the wiki page "other-page", i.e. the interpreted markdown, not the source code
Output of checks
This bug happens on GitLab.com
Proposal
- Redirect requests for
/-/wikis/page.mdto/-/wikis/page. - Introduce a dedicated
rawaction to get the page source, as we do for blobs in the project repository.