TOC button disappears in snippets when switching back from Code to Preview
### Summary
On a snippet containing a Markdown file, switching from the Preview tab to the Code tab
and back, the TOC (Table of Contents) button disappears. It reappears on page reload.
{width=450 height=291}
This does not reproduce in a repository file preview.
### Steps to reproduce
1. Create a snippet with a Markdown file that contains headings.
1. Confirm the TOC button is visible on the Preview tab.
1. Switch to the Code tab.
1. Switch back to the Preview tab.
### What is the current *bug* behavior?
The TOC button disappears.
### What is the expected *correct* behavior?
The TOC button remains visible after switching back to Preview.
### Output of checks
This bug happens on GitLab.com
issue