-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple subheadings in same fenced div don't appear in the TOC #8518
Comments
That's true. Originally we didn't include any of the headings inside fenced divs; the thought was that these created isolated environments which might be used, e.g., for callouts. A problem with this was that round-trip got broken in certain cases, since in some formats pandoc will add the section divs around headings. So we supported this case only: a div starting with a heading with no other headings in it. I'm not sure we want to support the other case, for the reasons mentioned above. |
Okay, I understand. Let me tell my scenario, where the fenced divs are not "isolated environments": We're using the class name of the fenced divs in combination with a Lua filter to implement conditional sections (i.e. the rendered output's sections depend on metadata flags). Here we of course also want all the "enabled sections" to be part of the TOC. Maybe implement the TOC inclusion of fenced div headings behind a flag to support both scenarios? |
That makes sense. Have you thought of using a class on the headers to be enabled/omitted instead? |
This wouldn't work because we're using these "conditional fenced divs" in all kind of ways: Conditional div blocks within a heading; all subheadings conditional within a heading; only parts of the subheadings conditional within a heading, ... And here the instrument of these fenced divs plus the filter works really great in the body text, just the TOC has the mentioned issue. |
Explain the problem.
Render the following markdown with
pandoc/core Input.md --self-contained --toc --output=Output.html
.Result:
So it seams that when a fenced div contains more than one subheading the contained subheadings aren't rendered in the TOC.
Pandoc version?
The text was updated successfully, but these errors were encountered: