Steps to replicate the issue (include links if applicable):
When applying the newer version of Parsoid, the table of contents is replicated in the second section of the article (directly after the introduction).
The problem is shown using Vector 2010 and Vector 2022, regardless of the browser.
Community post about the problem: https://w.wiki/L4nA
What happens?:
- The table of contents is replicated in the second section of articles.
Example of articles that the table of contents is shown using the newer version of Parsoid: https://w.wiki/L4ne, https://w.wiki/L4ng,
Example of an article, the table of contents is shown using the older version of Parsoid: https://w.wiki/L4nk .
- It differs as some articles, the table of contents is shown on the old version of Parsoid, and others on the newer version of it.
What should have happened instead?:
- The table of contents should not be shown at all there.
Example of an article that works well regardless of the Parsoid, browser, or version of Vector (2010, 2022): https://w.wiki/3QML
Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):
Other information (browser name/version, screenshots, etc.):

