Fix dead toc_title auto-fallback in typst outline template - #14847
Merged
Conversation
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.
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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