TOC `#null` anchors break navigation for RST/MediaWiki headings
### Summary
When previewing a reStructuredText (RST) or MediaWiki file that includes
an inline table of contents (such as the `.. contents::` directive in RST),
clicking any heading in the TOC dropdown does nothing.
The anchor points to `#null`.
{width=434 height=450}
Note that the inline table of contents generated by each markup syntax itself
(for example via the `.. contents::` directive in RST)
works fine.
### Steps to reproduce
1. Create an `.rst` file with a `.. contents::` directive to a repo such as:
```markdown
.. contents::
Heading 1
===========
```
2. Open the TOC dropdown in Preview and click any heading:
{width=603 height=350}
### What is the current *bug* behavior?
Clicking a heading in the TOC dropdown points to `#null` and doesn't navigate anywhere:
{width=900 height=288}
### What is the expected *correct* behavior?
Clicking a heading in the TOC dropdown should scroll to that heading.
### Output of checks
This bug happens on GitLab.com
### References
- #600361+
issue