mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
LRF Input: Workaround for broken LRF files from BookDesigner that have incomplete TextStyle elements
This commit is contained in:
parent
e98ce20b0d
commit
a7bf3105ed
@ -854,7 +854,8 @@ class Text(LRFStream):
|
|||||||
if len(self.content) == 0:
|
if len(self.content) == 0:
|
||||||
current_style = style.copy()
|
current_style = style.copy()
|
||||||
name, val = action[0], LRFObject.tag_to_val(action, self, tag, None)
|
name, val = action[0], LRFObject.tag_to_val(action, self, tag, None)
|
||||||
if name and current_style[name] != val:
|
if name and (name not in current_style or current_style[name]
|
||||||
|
!= val):
|
||||||
# No existing Span
|
# No existing Span
|
||||||
if len(self.content) > 0 and isinstance(self.content[-1], self.__class__.Span):
|
if len(self.content) > 0 and isinstance(self.content[-1], self.__class__.Span):
|
||||||
self.content[-1].attrs[name] = val
|
self.content[-1].attrs[name] = val
|
||||||
|
Loading…
x
Reference in New Issue
Block a user