quarto-dev / quarto-dev/quarto

Outline includes headers in divs

Open
#829 3 comments 0 reactions 1 assignee View on GitHub

@vezwork is already working on this.

Since Sep 26, 2025.

Dominant language
TypeScript
Stars
645
Forks
62
Avg merge
17h 42m
Merged PRs (30d)
13

Description

A regression of https://github.com/quarto-dev/quarto-cli/issues/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)
Image

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)
Image

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!?
:::

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.