Skip to content

Fix stale LB25 state causing spurious breaks after colon-separated text#523

Merged
JimBobSquarePants merged 3 commits intomainfrom
js/fix-522
Apr 7, 2026
Merged

Fix stale LB25 state causing spurious breaks after colon-separated text#523
JimBobSquarePants merged 3 commits intomainfrom
js/fix-522

Conversation

@JimBobSquarePants
Copy link
Copy Markdown
Member

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following matches the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

This pull request significantly improves the maintainability and clarity of the LineBreakEnumerator implementation in src/SixLabors.Fonts/Unicode/LineBreakEnumerator.cs by adding detailed, specification-driven comments, refactoring for readability, and enhancing documentation. Additionally, it introduces a new unit test to cover a previously reported issue.

Documentation and Maintainability Improvements:

Correctness and Algorithmic Clarifications:

  • Refactored and clarified handling of specific Unicode line break rules (e.g., LB8a, LB22, LB24, LB25, LB30, LB30b, LB31) to ensure correct state tracking and to make the interaction between pair-table logic and stateful exceptions more transparent. [1] [2] [3] [4] [5] [6] [7] [8]

Testing:

  • Added a new test (Issues_522) to verify that the line break enumerator does not break within an alphanumeric run following a colon, addressing a previously reported issue and improving test coverage.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82%. Comparing base (7396060) to head (75f3567).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main    #523   +/-   ##
=====================================
- Coverage     82%     82%   -1%     
=====================================
  Files        305     305           
  Lines      21534   21540    +6     
  Branches    3165    3167    +2     
=====================================
+ Hits       17818   17822    +4     
- Misses      2901    2903    +2     
  Partials     815     815           
Flag Coverage Δ
unittests 82% <100%> (-1%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JimBobSquarePants JimBobSquarePants merged commit 4ca2629 into main Apr 7, 2026
10 checks passed
@JimBobSquarePants JimBobSquarePants deleted the js/fix-522 branch April 7, 2026 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant