quarto-dev / quarto-dev/quarto-cli
HTML: Sections rendered within Callouts containing a desginated title will increment section-numbering in the TOC, but do not show on the TOC itself, resulting in gaps therein
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Description
Bug description
When encompassing a section within a callout which has its title explicitly defined, this section will no longer be rendered as part of the TOC when converting to html. The line will still be visually rendered as a section within the callout; it will just not appear on the TOC. See Section 2.
-
As expected, callouts which take their name implicitly from the first header encountered within do not exhibit this problem; as they convert that heading to the name of the callout and remove it from their body (see
Section 3). -
Callouts which encounter normal text before the first heading within will render that heading properly within the document-body, but will not add it to the TOC (this functions as expected, see
Section 4).
Callouts which begin with a heading will render that heading properly within the document-body, but will not add it to the TOC (as expected).
Steps to reproduce
- Create the following note:
---
title: "T"
format:
html:
toc: true
toc-depth: 3
number-sections: true
number-depth: 3
---
# Section One
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
::: {.callout-important collapse="true" title="Step-By-Step-Guide to populating section '1. Grouping' when facetting."}
# Section 2
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
:::
::: {.callout-important collapse="true"}
# Section 3
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
:::
::: {.callout-important collapse="true"}
dawdwa
# Section 4
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
:::
# Section 5
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
- Convert the document via the CLI, using
quarto render index.qmd
Alternatively, use the quarto-package for R, which yields the same results. Code was run via RStudio, session was refreshed immediately before execution.
- Inspect the results
Expected behavior
If a section is rendered as such, it should be part of the TOC. It could be argued that sections within callouts should not be rendered into the TOC, but in that case they certainly should not increment the TOC's numbering.
That means that Section
1should be numbered and be part of the TOC. As it is rendered in the TOC, it should increment the section numbering in the TOC. (works)2should either not be rendered as a section in the text, or be rendered as a section and be part of the TOC. It should increment the section numbering in the TOC if it is rendered in the TOC.3should not be part of the TOC as it got converted to the callout's title. It should not be part of the TOC and should not increment section numbering4should either not be rendered as a section in the text, or be rendered as a section and be part of the TOC. It should increment the section numbering in the TOC if it is rendered in the TOC.5is a completely normal section, outside any callout. It should be rendered. (works)
Actual behavior
Sections 2 & 4 do not show up in the TOC although they are rendered in the text.
Section 3 is not rendered as a section at all, instead gets converted to the callout's name.
Your environment
R-version via version:
platform x86_64-w64-mingw32
arch x86_64
os mingw32
crt ucrt
system x86_64, mingw32
status
major 4
minor 2.3
year 2023
month 03
day 15
svn rev 83980
language R
version.string R version 4.2.3 (2023-03-15 ucrt)
nickname Shortstop Beagle
RStudio.Version():
$mode
[1] "desktop"
$version
[1] ‘2023.6.1.524’
$long_version
[1] "2023.06.1+524"
$release_name
[1] "Mountain Hydrangea"
OS:
SystemModel : HP ENVY x360 Convertible 15-eu0xxx
SystemCPU : AMD Ryzen 5 5500U with Radeon Graphics
SystemGPU : AMD Radeon(TM) Graphics v30.0.14056.5001 @ 512.00 MB RAM
SystemType : x64-based PC
SystemRAM : 15696 MB
SystemOS : 10.0.22621 64-bit v10.0.22621 (WIN32_NT)
SystemLocale : de-DE (0x0407)
Quarto check output
[>] Checking versions of quarto binary dependencies...
Pandoc version 3.1.1: OK
Dart Sass version 1.55.0: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
Version: 1.3.433
Path: C:\Users\Claudius Main\AppData\Local\Programs\Quarto\bin
CodePage: 1252
[>] Checking basic markdown render....OK
[>] Checking Python 3 installation....OK
Version: 3.11.1
Path: C:/Users/Claudius Main/AppData/Local/Programs/Python/Python311/python.exe
Jupyter: (None)
Jupyter is not available in this Python installation.
Install with py -m pip install jupyter
[>] Checking R installation...........OK
Version: 4.2.3
Path: C:/Users/CLAUDI~1/AppData/Local/Programs/R/R-42~1.3
LibPaths:
- C:/Users/Claudius Main/AppData/Local/Programs/R/R-4.2.3/library
knitr: 1.43
rmarkdown: 2.22
[>] Checking Knitr engine render......OK
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running quarto render index.qmd with the reproduction document and inspecting the generated HTML TOC alongside Sections 2–5. Trace the Quarto CLI's HTML callout and section-numbering handling to determine why rendered headings are counted but omitted from the TOC. Done means the documented callout cases produce consistent TOC entries and numbering.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- cli, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100