mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1043 (Conversion Error: LIT to LRF)
This commit is contained in:
parent
42a3b5f3b7
commit
ce468602a0
@ -778,11 +778,11 @@ class HTMLConverter(object, LoggingInterface):
|
||||
@param css: A dict
|
||||
'''
|
||||
src = tag.string if hasattr(tag, 'string') else tag
|
||||
if len(src) > 32767:
|
||||
if len(src) > 32760:
|
||||
pos = 0
|
||||
while pos < len(src):
|
||||
self.add_text(src[pos:pos+32767], css, pseudo_css, force_span_use)
|
||||
pos += 32767
|
||||
self.add_text(src[pos:pos+32760], css, pseudo_css, force_span_use)
|
||||
pos += 32760
|
||||
return
|
||||
src = src.replace('\r\n', '\n').replace('\r', '\n')
|
||||
|
||||
|
@ -118,7 +118,6 @@ def writeLineWidth(f, width):
|
||||
def writeUnicode(f, string, encoding):
|
||||
if isinstance(string, str):
|
||||
string = string.decode(encoding)
|
||||
|
||||
string = string.encode("utf-16-le")
|
||||
length = len(string)
|
||||
if length > 65535:
|
||||
|
@ -258,7 +258,10 @@ class BooksModel(QAbstractTableModel):
|
||||
for i in range(1, k):
|
||||
ids.extend([idx-i, idx+i])
|
||||
ids = ids + [i for i in range(l, r, 1) if i not in ids]
|
||||
try:
|
||||
ids = [self.db.id(i) for i in ids]
|
||||
except IndexError:
|
||||
return
|
||||
self.cover_cache.set_cache(ids)
|
||||
|
||||
def current_changed(self, current, previous, emit_signal=True):
|
||||
|
Loading…
x
Reference in New Issue
Block a user