Also handle soft hyphens with trailing spaces

This commit is contained in:
Kovid Goyal 2024-03-02 16:57:25 +05:30
parent b0d3fe6677
commit c38bacc0ba
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -124,6 +124,9 @@ class TextRun:
add_text(' ', True)
makeelement(r, 'w:softHyphen')
elif x:
if not preserve_whitespace and x.startswith(' ') and len(r) and r[-1].tag and 'softHyphen' in r[-1].tag:
x = x.lstrip()
add_text(' ', True)
add_text(x, preserve_whitespace)
else:
add_text('', preserve_whitespace)