Skip to content

Fix dead toc_title auto-fallback in typst outline template - #14847

Merged
cderv merged 3 commits into
mainfrom
typst-toc-title-dead-fallback-2
Sep 4, 2026
Merged

Fix dead toc_title auto-fallback in typst outline template#14847
cderv merged 3 commits into
mainfrom
typst-toc-title-dead-fallback-2

Conversation

@cderv

@cderv cderv commented Sep 3, 2026

Copy link
Copy Markdown
Member

The typst toc block computes a fallback title (auto when toc_title is none) but passes toc_title directly to outline() instead of the computed local, so the fallback never applies.

Found while investigating #14786. Quarto always fills toc-title metadata before pandoc runs for a normal render, so this had no visible effect. A user Lua Meta filter that removes toc-title does reach the none case, which is the exact path #14786 is investigating.

Added a regression test that removes toc-title via a filter and asserts on the compiled PDF text, since asserting on the generated .typ source would just re-check the line the fix changed rather than the outline's actual rendered title.

Related to #14786

The toc block computed a title fallback (auto when toc_title is none)
but passed toc_title directly to outline() instead of the computed
local, so the fallback never applied. Harmless today since quarto
always fills toc-title before pandoc runs, but restores the safety
net for a none toc_title.
A user Lua Meta filter that removes toc-title reaches the
toc_title == none path in typst-template.typ's article() function
(the case the previous commit fixed) even though quarto always
fills toc-title before pandoc runs for a normal render. Asserts on
the compiled PDF text rather than the generated .typ source, since
a .typ-text assertion would just re-check the source line changed
by the fix rather than the outline's actual rendered title.
@posit-snyk-bot

posit-snyk-bot commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@cderv
cderv merged commit c5805fa into main Sep 4, 2026
51 checks passed
@cderv
cderv deleted the typst-toc-title-dead-fallback-2 branch September 4, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants