diff --git a/src/calibre/ebooks/mobi/writer.py b/src/calibre/ebooks/mobi/writer.py index 758d560379..1a58628764 100644 --- a/src/calibre/ebooks/mobi/writer.py +++ b/src/calibre/ebooks/mobi/writer.py @@ -189,15 +189,15 @@ class Serializer(object): path = urldefrag(ref.href)[0] if hrefs[path].media_type not in OEB_DOCS: continue - + if ref.type == 'other.start' : # Kindle-specific 'Start Reading' directive buffer.write('') - else: + buffer.write(' />') + else: buffer.write(' thisRecord : thisRecordPrime = (offset + length) // RECORD_SIZE - + sectionChangesInThisRecord = True sectionChangedInRecordNumber = thisRecordPrime self._currentSectionIndex += 1 # <<< @@ -669,7 +669,7 @@ class MobiWriter(object): continue # If no one has taken the openingNode slot, it must be us - # This could happen before detecting a section change + # This could happen before detecting a section change if self._HTMLRecords[thisRecord].openingNode == -1 : self._HTMLRecords[thisRecord].openingNode = myIndex self._HTMLRecords[thisRecord].openingNodeParent = self._currentSectionIndex @@ -1468,7 +1468,7 @@ class MobiWriter(object): record0.write('\0\0\0\x01') # 0xb8 - 0xbb : FCIS record number - if FCIS_FLIS : + if FCIS_FLIS and self._indexable: # Write these if FCIS/FLIS turned on # 0xb8 - 0xbb : FCIS record number record0.write(pack('>I', self._fcis_number))