Skip to content

fix: leave Quarto's book title-block code block alone - #89

Merged
mcanouil merged 3 commits into
mainfrom
fix/skip-quarto-title-block
Nov 12, 2026
Merged

mcanouil merged 3 commits into
mainfrom
fix/skip-quarto-title-block

Conversation

@mcanouil

Copy link
Copy Markdown
Owner

When a Quarto book is rendered to one file (Typst, PDF, DOCX, EPUB), Quarto puts the front matter of each chapter into a code block with the class quarto-title-block.
A Quarto filter later finds that block by its class and replaces it with the chapter's title block.
code-window ran first and wrapped it, so an empty window named "quarto-title-block" showed at the start of any chapter with its own front matter.

The language pass, the HTML pass and the Typst pass now skip that block, so it reaches Quarto as Quarto wrote it.
HTML books render each chapter on its own page and never get this block.
I found no other code block that Quarto inserts with a quarto- class, so the check names this one class only.

A small book fixture under tests/fixtures/book/ renders to Typst, and tests/run.sh checks that only the chapter's own code block gets a window.
The test fails without the fix and the full suite passes with it.

A book rendered to one file puts each chapter's front matter into a code
block with the class quarto-title-block, which a Quarto filter later
replaces with the chapter's title block. code-window wrapped it first, so
an empty "quarto-title-block" window showed at the start of the chapter.
@mcanouil mcanouil added the Type: Bug 🐛 Issues related to bugs, errors, or mistakes label Nov 12, 2026
@mcanouil mcanouil self-assigned this Nov 12, 2026
@mcanouil
mcanouil marked this pull request as ready for review November 12, 2026 15:06
@mcanouil
mcanouil merged commit 937d1c6 into main Nov 12, 2026
@mcanouil
mcanouil deleted the fix/skip-quarto-title-block branch November 12, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Bug 🐛 Issues related to bugs, errors, or mistakes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant