mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
AZW3 Output: Handle the case of a link pointing to the last line of text in the document. Fixes #1011330 (cannot convert rtf to azw3)
This commit is contained in:
parent
7f321ef0d9
commit
0ed633752a
@ -372,6 +372,11 @@ class Chunker(object):
|
||||
# the chunk immediately after
|
||||
pos_fid = (chunk.sequence_number, 0, offset)
|
||||
break
|
||||
if chunk is self.chunk_table[-1]:
|
||||
# This can happen for aids very close to the end of the the
|
||||
# end of the text (https://bugs.launchpad.net/bugs/1011330)
|
||||
pos_fid = (chunk.sequence_number, offset-chunk.insert_pos,
|
||||
offset)
|
||||
if pos_fid is None:
|
||||
raise ValueError('Could not find chunk for aid: %r'%
|
||||
match.group(1))
|
||||
|
Loading…
x
Reference in New Issue
Block a user