fix: strip soft hyphen when joining merged text elements#3232
Merged
cau-git merged 2 commits intodocling-project:mainfrom Apr 17, 2026
Merged
Conversation
When predict_merges joins two text elements, _merge_elements always
inserts a space: new_item.text += f' {merged_elem.text}'.
For lines ending with U+00AD (SOFT HYPHEN) this produces 'abge rackerten'
instead of 'abgerackerten'. A soft hyphen marks an optional line-break
point in typeset text — the two fragments are halves of one word and must
be joined without a space, with the soft hyphen itself removed.
Check for trailing U+00AD before joining and use direct concatenation
(after stripping the soft hyphen) in that case.
Signed-off-by: stone <frank.schruefer@t-online.de>
Contributor
|
✅ DCO Check Passed Thanks @Frank-Schruefer, all your commits are properly signed off. 🎉 |
Contributor
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
dolfim-ibm
reviewed
Apr 6, 2026
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Member
|
@Frank-Schruefer Can you run a few times the |
Member
|
@Frank-Schruefer would love to get this in but we need the toolchain for linting/code checks to pass. Could you apply this please? |
Member
|
please rerun |
Signed-off-by: stone <frank.schruefer@t-online.de>
cau-git
approved these changes
Apr 17, 2026
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.
Problem
_merge_elementsalways joins two text elements with a space:For lines ending with U+00AD (SOFT HYPHEN) this produces
abge rackerteninstead ofabgerackerten.A soft hyphen marks an optional line-break point in typeset text (books, journals, typeset PDFs). The two fragments are halves of one hyphenated word and must be joined without a space, with the soft hyphen itself removed.
Fix
Check for trailing U+00AD before joining and use direct concatenation (after stripping the soft hyphen) in that case: