-
Notifications
You must be signed in to change notification settings - Fork 44
Description
A regression of quarto-dev/quarto-cli#716. @kmasiello mentioned that this had regressed in the Quarto slack (Posit internal slack link to discussion).
Note
Edit: I've realized that technically this is not a regression. In JJ's original implementation, only those headers which are inside callouts (divs with classname starting with callout-) were excluded. That is currently working. edit 2: that is actually not totally working. See subtle repro example at bottom of this issue.
However, it does seem that the outline should match the TOC that ends up in the rendered document. I believe that the TOC does not include headers inside ANY div. This issue describes that.
The outline should not include headers inside of divs / fences. This matches the TOC behaviour when rendering documents.
Incorrect (what is currently happening)

note: I realized after taking this screenshot and reading the relevant code that if the classname on the callout started with callout-
(note the trailing dash!) and not just callout
, it would've been excluded from the outline.
Correct (what should happen)

Repro example qmd:
---
title: "My document"
format: "html"
---
## Level 2 Title 1
### Level 3 Title 1
::: {.example-non-callout-div}
## Level 2 Title 1 - inside div
:::
### Level 3 Title 2
More subtle repro example edited down from what @kmasiello gave me:
::: {.callout-note}
## I should not be in the Outline!
when this text is here (on the line before the triple colon to end the div), this shows up in the outline and there is no div in the list of document tokens!?
:::