LRF Input: Workaround for broken LRF files from BookDesigner that have incomplete TextStyle elements

This commit is contained in:
Kovid Goyal 2011-02-18 19:36:02 -07:00
parent e98ce20b0d
commit a7bf3105ed

View File

@ -854,7 +854,8 @@ class Text(LRFStream):
if len(self.content) == 0:
current_style = style.copy()
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
if len(self.content) > 0 and isinstance(self.content[-1], self.__class__.Span):
self.content[-1].attrs[name] = val