Some headings missing from TOC dropdown in RST
### Summary In reStructuredText files, headings that are not immediately followed by body text may be missing from the table of contents dropdown. ### Steps to reproduce 1. Create an `.rst` file with the following content: ```rst Heading A ========= Heading B --------- Heading C ~~~~~~~~~ Heading D ^^^^^^^^^ Heading E ''''''''' Heading F """"""""" ``` 2. Preview the file and click the table of contents button. ### What is the current *bug* behavior? Some headings without body text do not appear in the TOC dropdown: ![rst_secsubtitle_before](/uploads/5e2d6b790812c1c47c27fbca65f8e650/rst_secsubtitle_before.png){width=422 height=378} ### What is the expected *correct* behavior? All headings appear in the TOC dropdown and link to their respective positions in the file. ### Output of checks This bug happens on GitLab.com ### References - !241282+
issue