Steps to replicate the issue (include links if applicable):
- Go to https://en.wikipedia.org/w/index.php?title=Wikipedia:Requests_for_comment/Deployment_of_Vector_(2022)&oldid=1111935414#Update_on_the_fixed_width_and_white_space
- Begin to scroll down. Notice how the "First impressions - limited width" heading activates in the TOC.
When you pass "Why have you replaced the area used for content by an empty space?" or any of the other headers below it, they do not not activate in the TOC. These headers are wrapped in a div (<div style="border:1px solid #aaa; padding:1em;">) which is likely causing this issue.
What should have happened instead?:
The headings should have activated in the TOC as you are viewing them.
Other information (browser name/version, screenshots, etc.): Firefox 107.0a1 (2022-09-23)
I wonder if this issue also occurs with headers that are placed in or are surrounded by templates. I haven't been able to test that though.