mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-03 00:46:09 +01:00
MOBI Output: Add a pad record at the end of the text records
This commit is contained in:
parent
972c770667
commit
d1b305cf66
1 changed files with 6 additions and 3 deletions
|
|
@ -446,9 +446,12 @@ def _generate_text(self):
|
|||
nrecords += 1
|
||||
offset += RECORD_SIZE
|
||||
data, overlap = self._read_text_record(text)
|
||||
extra = len(''.join(buf))%4
|
||||
if extra > 0 and INDEXING:
|
||||
self._records[-1] += '\0'*(4-extra)
|
||||
if INDEXING:
|
||||
extra = sum(map(len, buf))%4
|
||||
if extra == 0:
|
||||
extra = 4
|
||||
self._records.append('\0'*(4-extra))
|
||||
nrecords += 1
|
||||
self._text_nrecords = nrecords
|
||||
|
||||
def _generate_indxt(self, ctoc):
|
||||
|
|
|
|||
Loading…
Reference in a new issue