Hello all,
Currently, a table of content on a page with empty headers, will produce entries with valid anchors and indentation, but with a text equal to the title of the current page.
For instance, assuming a page with title test
and a content matching the snippet below:
{{toc/}}
= =
= level 1 =
== ==
== level 2 ==
The result is currently:
I’d like to know what result you’d expect. I’ve considered three options.
Option 1 - No toc entries for empty headers
In the case of the example above, the toc would be:
Cons: this could be misleading in case of empty heading in between non-empty headings. For instance:
= H1 =
= =
== H2 ==
H2 would be visually part of the H1 section even though it’s technically not part of it.
Option 2 - Toc entries with an empty text for empty headers
In this case the result for the snippet would be:
The entries are visible and match the actual structure of the document, but the links to empty headers are cannot be clicked.
Option 3 - Toc entries with a space for empty headers
In this case the result for the snippet would be:
In this case the entries are not fully matching the actual content of the empty headers, but they can be clicked.
Here is my +1 for option 3.
Related Jira issue: Loading...