Skip to content

Fix verse range marker placement bug - #371

Open
benjaminking wants to merge 2 commits into
mainfrom
fix-verse-range-alignment
Open

benjaminking wants to merge 2 commits into
mainfrom
fix-verse-range-alignment

Conversation

@benjaminking

@benjaminking benjaminking commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

This PR fixes #370, which is caused by verse ranges containing empty rows with empty alignment matrices, resulting in no markers being placed for the verse range. This changes the marker placement algorithm to ignore any empty rows with an empty alignment matrix.


This change is Reviewable

Ben King and others added 2 commits September 15, 2026 13:55
A verse range in the USFM being updated can be matched by more than one row.
The updater concatenated all of their texts but kept only the last row's
metadata, so the place markers handler received alignment info that did not
describe the text it was given.

Extracting a verse range puts all of its text on the first verse and leaves
the rest empty, so the common shape is one row with text followed by empty
rows. The empty row's metadata won, its alignment matrix was empty, and the
handler silently placed no markers at all for that range.

The block now carries every matched row's metadata alongside the existing
single dict, which is left as it was so that existing handlers reading
block.metadata are unaffected. The place markers handler ignores rows that
have no alignment info or an empty alignment matrix, since they contributed
no text to align. If more than one row is left it warns, as only one row's
alignment can be used and it describes only part of the block's text.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@claude

claude Bot commented Sep 15, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@Enkidu93
Enkidu93 requested a review from ddaspit September 17, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Marker placement does not occur in verse ranges

1 participant