fix: stand the Skylighting hot-fix down with the filter - #71
Merged
Merged
Conversation
The hot-fix filters asked hotfix_skylighting alone, while the pass that declares the Typst colour helpers asks whether the render draws chrome at all. With the filter off, the helpers were never declared and the override that calls them still went into the document, so Typst stopped on _cw-page-bg and a document setting enabled: false failed to compile. The hot-fix now asks draws_chrome, like every other pass that exists only to serve the chrome.
The hot-fix gate becomes the one-line form the two passes above it use, and the two new tests become one loop over both fixtures.
The test greps for the "_cw-" prefix rather than the Skylighting override alone, so the annotation rule that can replace it and the inline-code fallback are covered too. The documentation said typst-title was the hot-fix that follows enabled. All three follow it, so a document with the filter off takes none of them.
The hot-fix contributes a block pass and an inline pass, and the inline one writes a box that names no helper where the theme gives a background colour. Both disabled fixtures gain inline code, and the loop asserts the absence of that box alongside the absence of the helpers. The loop moves under its own banner, since it was splitting the section on block languages.
Both hot-fix assertions are negative, so a missing file answered them the same way a clean render does. The loop now checks for the file first. The examples page also loses a count that no longer matched the text under it, and stops listing effects as though they were all of them.
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.
A Typst document that sets
enabled: falsefailed to compile, stopping onunknown variable: _cw-page-bg.The extension declares its Typst colour helpers from
code_window.Pandoc, which returns before writing anything when the filter is off. The Skylighting hot-fix was gated onhotfix_skylightingalone, so it still wrote an override calling those helpers, and Typst stopped on the first name it could not resolve. The hot-fix now asksdraws_chrome(), the same questionmark_cell_outputandnormalise_languagealready ask, so it stands down with the filter.The module contributes two passes, and only one of them failed loudly. The inline pass writes a self-contained box where the theme gives a background colour, so with the filter off it added backgrounds nobody asked for and still compiled. Both passes are now covered.
_cw-helper calls and of the inline box.typst-titlewas the hot-fix that followsenabled. All three follow it, so a document with the filter off takes none of them.Verified locally:
tests/run.sh27 passed, 0 failed; every fixture andexample.qmdcompiles to Typst;shellcheck,shfmtandmarkdownlint-cli2clean. Reverting the gate in a scratch copy makes the render fail and both new assertions fire, so they catch the regression rather than passing by construction.