fix: strip soft hyphen when joining merged text elements (#3232)
* fix: strip soft hyphen when joining merged text elements
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>
* style: apply ruff formatting
Signed-off-by: stone <frank.schruefer@t-online.de>
---------
Signed-off-by: stone <frank.schruefer@t-online.de> F
Frank-Schruefer committed
827489275e16892ec75f767637de2a9451448441
Parent: 043ed2d
Committed by GitHub <noreply@github.com>
on 4/17/2026, 5:15:41 AM