# DiscoTOC doesn't work with headings in lists

**URL:** https://meta.discourse.org/t/discotoc-doesnt-work-with-headings-in-lists/308570
**Category:** Bug
**Tags:** disco-toc
**Created:** [May 18, 2024, 10:15pm UTC](https://meta.discourse.org/t/discotoc-doesnt-work-with-headings-in-lists/308570 "2024-05-18T22:15:07Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [May 18, 2024, 10:15pm UTC](https://meta.discourse.org/t/discotoc-doesnt-work-with-headings-in-lists/308570/1 "2024-05-18T22:15:07Z")

</div>

While reading [Discourse AI](https://meta.discourse.org/t/official-discourse-ai-plugin/259214), I noticed an issue with the TOC component. After reading the “Embeddings” paragraph, the TOC collapses. This seems to be caused by the next two headlines being part of a list.

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [June 14, 2024, 3:33pm UTC](https://meta.discourse.org/t/discotoc-doesnt-work-with-headings-in-lists/308570/3 "2024-06-14T15:33:38Z")

</div>

thanks @Moin , I can repro this. Sorry I didn’t seee this one til today. I moved to #Contribute > Bug because that collapsing doesn’t seem like the expected behavior.

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [August 29, 2024, 8:10am UTC](https://meta.discourse.org/t/discotoc-doesnt-work-with-headings-in-lists/308570/4 "2024-08-29T08:10:49Z")

</div>

The TOC does not collapse anymore 🎉

However, the headings from the list are still not shown in the TOC
