Repository navigation
Port 'Fix verse range marker placement bug' from machine.py - #559
claude[bot] wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-authored-by: Eli C. Lowry <83078660+Enkidu93@users.noreply.github.com>
| foreach (UsfmUpdateBlockRow row in block.Rows) | ||
| { | ||
| // Rows that contributed no text, such as the later verses of a verse range, have nothing to align | ||
| if (row.Text.Trim().Length == 0) |
There was a problem hiding this comment.
FYI: F1. A row with null Text now crashes the update: row.Text.Trim() throws NullReferenceException, which is not a UsfmUpdateBlockHandlerException, so the error handler never sees it. UpdateUsfmRow accepts null text, and the old t + " " path tolerated it. Python types text: str, so this gap exists only in C#. string.IsNullOrWhiteSpace(row.Text) would cover it. Unverified: reasoned from the code, not run.
Public API: Upstream in sillsdev/machine.py, not this PR: in Findings: F1 new, unverified. Reviewed at 2e94abb |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #559 +/- ##
==========================================
+ Coverage 74.57% 74.63% +0.05%
==========================================
Files 453 454 +1
Lines 38314 38420 +106
Branches 5280 5300 +20
==========================================
+ Hits 28573 28675 +102
- Misses 8576 8579 +3
- Partials 1165 1166 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Quick summary
Marker placement now works for verse ranges that include empty rows, which previously got no markers placed.
UsfmUpdateBlock.Metadatais replaced byRows, so this is a public API change. Nothing outside the update-block pipeline is touched.Where to look
UpdateUsfm_VerseRangeWithEmptyTrailingRow,GetBlockAlignmentInfo_ShiftsLaterRowsByTokenCountsGetBlockAlignmentInfo_RejectsAlignedWordPairOutsideRowTokensUpdateUsfm_EndStyleMarkerFollowsStartMarkerDeliberately not included
SIL.Machinehas no logging dependency, so those cases silently leave markers unplaced.Validation
./local_check.sh --agent-strict-- local_check: PASSEDIssue / porting context
Ports sillsdev/machine.py#371.
Closes #558
🤖 Generated with Claude Code
This change is