Skip to content

Markdown links to header id anchor of another file doesn't work under certain conditions

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

GitLab Markdown Guide says:

Using header ID anchors:

- This links to [a section on a different Markdown page, using a "#" and the header ID](index.md#overview)

But that feature doesn't work under certain conditions described below:

And that bug will go away as soon as you add into file with link either link to whole target file like [target file](subfolder/target_file.md) or link with relative path like [Chapter 1](./target_file.md#chapter-1).

Steps to reproduce

All steps has been done in .

Example Project

example project

What is the current bug behavior?

Link to header id anchor referred to 404 page because missing -/blob part in the generated url. But it happens only until you don't specify other links to the same target file.

What is the expected correct behavior?

Link should refer to specified chapter of target file regardless of other links in the source file to the same target file.

Output of checks

This bug happens on GitLab.com

Edited by 🤖 GitLab Bot 🤖