fix: preserve all markup boundaries only except special list cases#466
Open
QuadnucYard wants to merge 2 commits intotypstyle-rs:masterfrom
Open
fix: preserve all markup boundaries only except special list cases#466QuadnucYard wants to merge 2 commits intotypstyle-rs:masterfrom
QuadnucYard wants to merge 2 commits intotypstyle-rs:masterfrom
Conversation
📊 Benchmark Performance Reportgroup base pr
----- ---- --
pretty-ai-comprehensive-showcase 1.00 879.6±15.17µs ? ?/sec 1.00 878.1±9.81µs ? ?/sec
pretty-cetz-manual 1.00 745.5±19.69µs ? ?/sec 1.00 744.2±13.98µs ? ?/sec
pretty-codly 1.00 1754.7±20.44µs ? ?/sec 1.00 1749.1±29.98µs ? ?/sec
pretty-cpe 1.00 13.0±1.39ms ? ?/sec 1.00 13.0±0.82ms ? ?/sec
pretty-deep-nested-args 1.01 16.9±0.33µs ? ?/sec 1.00 16.8±0.61µs ? ?/sec
pretty-fletcher-diagram 1.00 510.6±5.06µs ? ?/sec 1.01 513.4±6.34µs ? ?/sec
pretty-fletcher-draw 1.00 1228.9±24.42µs ? ?/sec 1.01 1240.1±9.70µs ? ?/sec
pretty-tablex 1.00 3.3±0.01ms ? ?/sec 1.01 3.3±0.02ms ? ?/sec
pretty-touying-core 1.01 2.1±0.03ms ? ?/sec 1.00 2.1±0.01ms ? ?/sec
pretty-touying-utils 1.01 1183.0±29.67µs ? ?/sec 1.00 1174.5±22.37µs ? ?/sec
pretty-undergraduate-math 1.00 850.2±32.21µs ? ?/sec 1.01 860.2±58.77µs ? ?/sec📏 Binary Size Comparison
📦 Detailed Crate Size Diff (cargo-bloat)Note: Numbers above are a result of guesswork. They are not 100% correct and never will be. @@ -1,8 +1,8 @@
std 394.6 kB
clap_builder 323.0 kB
-typstyle_core 203.4 kB
+typstyle_core 204.1 kB
clap_complete 126.4 kB
typst_syntax 116.3 kB
similar 73.9 kB
typstyle 40.2 kB
walkdir 19.1 kBGenerated by GitHub Actions on 2026-01-29 03:49:52 UTC |
Collaborator
|
@codex review this |
|
To use Codex here, create a Codex account and connect to github. |
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.
Summary
Resolves #464.
Related: #356 (comment)
Changes
Checklist
Before submitting, please ensure you've done the following:
Testing
We might need a powerful fuzzer to generate stronger inputs than this:
Additional Notes
SPECIAL CASE: Force line break before first list/enum/term item in content blocks.
PROBLEM: In Typst, there are no "list" nodes - only individual list/enum/term item nodes.
The compiler groups items using indentation levels. When multiple items exist and the
first item appears on the first line without a preceding break, subsequent items lose
proper alignment because indentation becomes inconsistent.
SOLUTION: Force a line break before the first item when:
LIMITATION: This changes evaluation semantics by adding line breaks where none existed.
Without this fix, formatted code would break item hierarchy and cause incorrect rendering.