lalejand
(Loïc Alejandro)
6 בפברואר, 2026, 2:15pm
1
In my post, for aesthetic reasons, I use some “wrap” blocks. The TOC plugin does not display titles that are in “wrap” blocks. I would like it to do it.
“Pas de mini-webinaire” is not displayed in the TOC
Canapin
(Coin-coin le Canapin)
6 בפברואר, 2026, 2:48pm
2
It works for me
<div data-theme-toc="true"> </div>
Bonjour,
## Test 1
[wrap=miniWebinaire]
## **Pas de mini-webinaire**
On se retrouve en mars pour un mini-webinaire avec :mechanical_arm:
[/wrap]
## Test2
לייק 1
Moin
6 בפברואר, 2026, 4:42pm
3
Support for headings inside [wrap] was added in
main ← dereklputnam:main
merged 12:22AM - 13 Jan 26 UTC
# Summary
Adds support for finding headings inside wrap blocks (`.wrap` and `.d… -wrap` classes), which are commonly used for email filtering with the `[wrap=no-email]` BBCode tag.
# Problem
When users wrap content with [wrap=XYZ], headings inside those blocks were not included in the table of contents. The original selector only looked for direct descendants of body:
```javascript
"body > h1, body > h2, body > h3, body > h4, body > h5"
```
We specifically use [wrap=no-email] to block our content from pushing to the email notification, which essentially broke the TOC for us.
# Solution
Extended the heading selector to also find headings inside .wrap and .d-wrap blocks:
```
const selector = [
"body > h1", "body > h2", "body > h3", "body > h4", "body > h5",
"body > .wrap h1", "body > .wrap h2", "body > .wrap h3", "body > .wrap h4", "body > .wrap h5",
"body > .d-wrap h1", "body > .d-wrap h2", "body > .d-wrap h3", "body > .d-wrap h4", "body > .d-wrap h5"
].join(",");
```
Headings are combined and sorted by document order to maintain proper TOC structure.
# Files Changed
javascripts/discourse/services/toc-processor.js - Modified processPostContent() method
לייק 1
lalejand
(Loïc Alejandro)
8 בפברואר, 2026, 3:03pm
4
Hi,
I just reinstalled the component.
Not working for me.
Moin
8 בפברואר, 2026, 3:42pm
5
You are still on Discourse 3.5, so you don’t get the lastest version of the toc component because that won’t work with your Discourse install. You need to update your forum
לייק 1