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`. ![null-anchor](/uploads/9bbe1c53fcf1737ffb378d9c0925c330/null-anchor.mov){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: ![image](/uploads/7450d529de43c5b3b48af45a74985857/image.png){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: ![image](/uploads/c227abe0da8115194037f994088035f4/image.png){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