Skip to content

Commit 87f88a9

Browse files
committed
fix(pdf reflow): check if fragments text is empty before indexing
1 parent 93399c3 commit 87f88a9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

‎src/calibre/ebooks/pdf/reflow.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,7 @@ def join_fragments(self, opts):
902902
if match.left < frag.right:
903903
# Text overlaps. Do we have a blurred character?
904904
if len(match.text_as_string) == 1 \
905+
and len(frag.text_as_string) != 0 \
905906
and match.left + match.width > frag.right \
906907
and frag.text_as_string[-1] == match.text_as_string[0]:
907908
break # Overlapping same character, so ignore it

0 commit comments

Comments
 (0)