quarto-dev / quarto-dev/quarto-cli
Books: Table of Content picks up code-block comments as chapter titles
Open
Nobody has claimed this yet.
ast
books
bug
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Description
Bug description
Using
```{r, echo = FALSE}
# INITIALIZE CODE
hello <- 42
```
# Summary
In summary, this book has no content whatsoever.
in a Quarto Book chapter results in INITIALIZE CODE becoming the chapter title used in the table of content, although the Summary is still the title on the page. See below screenshot.

Session info
Ubuntu 20.04 with:
$ quarto --version
1.3.11
Checklist
- Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- Please format your issue so it is easier for us to read the bug report.
- Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- Please document the operating system you're running. If on Linux, please provide the specific distribution.
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 with the minimal .qmd example in the issue and render it as a Quarto Book using the reported case. Trace how the book table of contents identifies chapter titles, then verify that the code-block comment is excluded while the Summary heading remains the page and chapter title.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- content
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100