Headless
(Headless)
6. September 2022 um 20:35
1
Funktioniert das Inhaltsverzeichnis nicht, wenn sich Header in einem Div befinden? Ich versuche, ein Inhaltsverzeichnis mit zentrierten Headern zu erstellen, aber das scheint unmöglich zu sein.
Ich glaube, das wurde bereits erwähnt, wenn ich es richtig verstehe:
I have posts that have extra DIVs in their bodies. For example, On Storytelling - Public - Podcaster Community
The DIV which triggers the TOC generation is inside a DIV… and TOC notices that. But other headings, inside DIVs, don’t seem to get noticed by TOC.
[Screen Shot 2022-02-02 at 09.45.01]
…not the best screenshot. That’s an H2 in an arbitrary/just-for-styling DIV which does not appear in the TOC.
…not shown is the <div that triggers the TOC, which is inside the DIV with the crazy att…
We target the immediate child headings to exclude headings in quotes or oneboxes and other elements in the Table of Contents. Otherwise, we’d have to exclude them individually, which can be tedious.
Headless
(Headless)
6. September 2022 um 21:52
3
Soweit ich das beurteilen kann, gibt es im Grunde keine Lösung.
Canapin
(Coin-coin le Canapin)
25. August 2023 um 14:35
4
Es hängt davon ab, was Sie mit Ihren anderen HTML-Inhalten erreichen möchten.
Ich poste hier einen möglichen Workaround: TOC doesn't work when wrapped with HTML tags - #2 by Canapin