Repository navigation
Conversation
Signed-off-by: Varanasi Sathveek <sathveekvaranasi@gmail.com>
Contributor
|
✅ DCO Check Passed Thanks @VSathveek, all your commits are properly signed off. 🎉 |
Contributor
Merge Protections🟢 Merge protection satisfied — ready to merge. Show 1 satisfied protection🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
2 of 3 tasks
This was referenced Sep 11, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
3 tasks done
Contributor
Author
|
Gentle ping when someone has a moment — this is the |
This branch has not been deployed
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.
What
Follow-up to #4052, which fixed the same defect in
PageAssembleModel.sanitize_text.As noted there,
ReadingOrderModel._merge_elementshas the parallel bug for mergesacross cluster boundaries.
When two elements are merged, a trailing hyphen on the first is treated as a word
split and dropped whenever the continuation starts lowercase:
But a hyphen only splits a word when it is attached to that word (
"algo-"/"rithms"). A hyphen that follows whitespace is a literal character -- a danglingdash, a wrapped CLI flag, a minus sign -- and dropping it silently corrupts the
text.
Fix
Require the character before the trailing hyphen to be alphanumeric before treating
it as a word split. The soft-hyphen (U+00AD) branch is unchanged -- a soft hyphen is
always a split marker. When the hyphen is detached the elements are joined with a
space, exactly as the existing
elsebranch already does, so the character is kept.This only narrows the existing condition, so nothing de-hyphenated today stops being
de-hyphenated.
Tests
Extended
tests/test_readingorder_hyphenated_merges.pywith two detached-hyphencases (
"run -"+"prio now","the value is -"+"five units"). Both fail onmainand pass with this change; the three existing cases pass either way.No reference data changes: this only affects cross-element merges where a detached
hyphen meets a lowercase continuation, which none of the e2e fixtures exercise.