lalejand
(Loïc Alejandro)
6 februari 2026 om 14:15
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 februari 2026 om 14:48
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 like
Moin
6 februari 2026 om 16:42
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 like
lalejand
(Loïc Alejandro)
8 februari 2026 om 15:03
4
Hi,
I just reinstalled the component.
Not working for me.
Moin
8 februari 2026 om 15:42
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 like
system
(system)
gesloten
10 maart 2026 om 15:42
6
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.