Support table of contents button for org-mode file previews
## Problem
When viewing `.org` (org-mode) ~~or `.rst` (reStructuredText)~~ files in preview mode, the "Table of contents" button is not shown in the file header. It only appears for Markdown (`.md`) files.
|Markup| Screenshot |
|-|-|
| Markdown | {width=565 height=211} |
| Org | {width=567 height=72} |
| ~~RST~~ | ~~{width=576 height=58}~~ |
GitHub already supports a table of contents for org-mode ~~and reStructuredText~~ file views, so similar support in GitLab would be very helpful.
## Possible approach
- Add a filter to [`MarkupPipeline`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/banzai/pipeline/markup_pipeline.rb) so that org-mode ~~and rst~~ headings receive the same heading anchor information that Markdown gets
- [`_header_content.html.haml`](https://gitlab.com/gitlab-org/gitlab/-/blob/0d4392f7eefe68fefaae1e9f6e4317b797e481cc/app/views/projects/blob/_header_content.html.haml#L2) only outputs the table of contents container for files matching `Gitlab::MarkupHelper.gitlab_markdown?`; expand this to also include `.org` ~~and `.rst`~~
## Related
- #15405+
- #251204+
EDIT: Scoped down to org-mode only. `.rst` support is out of scope for this issue.
issue