Heading anchors in a snippet always scroll to first file even for other files
### Summary
When a snippet contains multiple markup files with the same heading,
clicking a heading anchor in any file beyond the first scrolls
to the first file's heading instead,
since identical headings across files end up with the same anchor.
{width=450 height=600}
Note that within a single file, duplicate headings are handled correctly and get auto-numbered suffixes (e.g. `#heading`, `#heading-1`, `#heading-2`).
### Affected Markup
Markdown, reStructuredText, org-mode, etc.
### Steps to reproduce
1. Create a snippet with multiple markup files, each containing an identical heading (e.g. `## Heading`)
1. Open the snippet preview and click a heading anchor in any file beyond the first
### What is the current *bug* behavior?
The page scrolls to the first file's heading with the same title.
### What is the expected *correct* behavior?
The page scrolls to the heading in the file you clicked.
### Output of checks
This bug happens on GitLab.com
### See also
- #604294+
- #603300+
issue