lalejand
(Loïc Alejandro)
6 فبراير 2026، 2:15م
1
في منشوري، لأسباب جمالية، أستخدم بعض كتل “wrap”. لا يعرض مكون الإضافي لجدول المحتويات (TOC) العناوين الموجودة في كتل “wrap”. أود أن يقوم بذلك.
“Pas de mini-webinaire” لا يظهر في جدول المحتويات
Canapin
(Coin-coin le Canapin)
6 فبراير 2026، 2:48م
2
يعمل لدي
<div data-theme-toc="true"> </div>
مرحباً،
## الاختبار 1
[wrap=miniWebinaire]
## **لا يوجد ندوة مصغرة**
نلتقي في مارس لندوة مصغرة مع:mechanical_arm:
[/wrap]
## الاختبار 2
Moin
6 فبراير 2026، 4:42م
3
تمت إضافة دعم للعناوين داخل [wrap] في
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
lalejand
(Loïc Alejandro)
8 فبراير 2026، 3:03م
4
مرحباً،
لقد أعدت تثبيت المكون للتو.
إنه لا يعمل بالنسبة لي.
Moin
8 فبراير 2026، 3:42م
5
أنت لا تزال على Discourse 3.5، لذا لن تحصل على أحدث إصدار لمكون جدول المحتويات (toc) لأن ذلك لن يعمل مع تثبيت Discourse الخاص بك. تحتاج إلى تحديث منتدىك