Repository navigation
Fix document set rules - #4768
Merged
Merged
Conversation
This fixes the flakiness of document set rules by changing their semantics to deviate a bit from normal set rule semantics. Instead of being an immutable operation that just passes down information, document set rules are now basically naive setters that really just mutate the relevant piece of document information. This means that - the information is not lost for an empty document - they can trivially depend on context - we get rid of the "document set rules must appear before any content" error Overall, this makes them less error-prone to use and since the document information is a singleton anyway, I think we don't lose much through them working a bit differently (i.e. not being scoped). Note that document set rules are still only allowed at the top-level, not within layout containers. This also adds a mechanism for adding special checks for specific tests, so that we can test that the document information is indeed correctly collected. Fixes #2710 Fixes #4065
1 task done
Contributor
|
Huge! Now I don't need a separate Now the only thing left to do is fix #2326 so that I can say the same thing about |
Dikluwe
pushed a commit
to Dikluwe/typst-crystalline
that referenced
this pull request
Sep 12, 2026
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.
This fixes the flakiness of document set rules by changing their semantics to deviate a bit from normal set rule semantics. Instead of being an immutable operation that just passes down information, document set rules are now basically naive setters that really just mutate the relevant piece of document information.
This means that
Overall, this makes them less error-prone to use and since the document information is a singleton anyway, I think we don't lose much through them working a bit differently (i.e. not being scoped). Note that document set rules are still only allowed at the top-level, not within layout containers.
This also adds a mechanism for adding special checks for specific tests, so that we can test that the document information is indeed correctly collected.
Fixes #2710
Fixes #4065
Fixes #4769