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
|
@param css: A dict
|
||||||
'''
|
'''
|
||||||
src = tag.string if hasattr(tag, 'string') else tag
|
src = tag.string if hasattr(tag, 'string') else tag
|
||||||
if len(src) > 32767:
|
if len(src) > 32760:
|
||||||
pos = 0
|
pos = 0
|
||||||
while pos < len(src):
|
while pos < len(src):
|
||||||
self.add_text(src[pos:pos+32767], css, pseudo_css, force_span_use)
|
self.add_text(src[pos:pos+32760], css, pseudo_css, force_span_use)
|
||||||
pos += 32767
|
pos += 32760
|
||||||
return
|
return
|
||||||
src = src.replace('\r\n', '\n').replace('\r', '\n')
|
src = src.replace('\r\n', '\n').replace('\r', '\n')
|
||||||
|
|
||||||
|
@ -118,7 +118,6 @@ def writeLineWidth(f, width):
|
|||||||
def writeUnicode(f, string, encoding):
|
def writeUnicode(f, string, encoding):
|
||||||
if isinstance(string, str):
|
if isinstance(string, str):
|
||||||
string = string.decode(encoding)
|
string = string.decode(encoding)
|
||||||
|
|
||||||
string = string.encode("utf-16-le")
|
string = string.encode("utf-16-le")
|
||||||
length = len(string)
|
length = len(string)
|
||||||
if length > 65535:
|
if length > 65535:
|
||||||
|
@ -258,7 +258,10 @@ class BooksModel(QAbstractTableModel):
|
|||||||
for i in range(1, k):
|
for i in range(1, k):
|
||||||
ids.extend([idx-i, idx+i])
|
ids.extend([idx-i, idx+i])
|
||||||
ids = ids + [i for i in range(l, r, 1) if i not in ids]
|
ids = ids + [i for i in range(l, r, 1) if i not in ids]
|
||||||
ids = [self.db.id(i) for i in ids]
|
try:
|
||||||
|
ids = [self.db.id(i) for i in ids]
|
||||||
|
except IndexError:
|
||||||
|
return
|
||||||
self.cover_cache.set_cache(ids)
|
self.cover_cache.set_cache(ids)
|
||||||
|
|
||||||
def current_changed(self, current, previous, emit_signal=True):
|
def current_changed(self, current, previous, emit_signal=True):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user