TOC in a snippet always shows first file's headings even for other files
### Summary
When a snippet contains multiple markup files,
the Table of Contents dropdown in the preview always
lists the headings from the first file,
regardless of which file is selected.
The second and subsequent files
never show their own headings in the TOC.
### Steps to reproduce
1. Go to the new snippet form
1. Add a markup file (`file1.md`) with several headings (e.g. `# Heading A`, `## Heading A-2`)
1. Add another markup file (`file2.md`) with different headings (e.g. `# Heading B`, `## Heading B-2`)
1. Save the snippet
1. In the preview for `file2.md`, click the Table of contents button
### What is the current *bug* behavior?
The TOC for `file2.md` shows the headings from `file1.md` (Heading A, Heading A-2):
{width=595 height=507}
### What is the expected *correct* behavior?
The TOC for `file2.md` shows `file2.md`'s own headings (Heading B, Heading B-2).
### Output of checks
This bug happens on GitLab.com
issue