Conversion: Fix a regression in the last release that broke conversion

of a few files with comments just before a chapter start. See #1188635
This commit is contained in:
Kovid Goyal 2013-07-22 18:47:25 +05:30
parent c6bdca08aa
commit e500792586

View File

@ -35,7 +35,7 @@ def at_start(elem):
for x in body.iter():
if x is elem:
return True
if getattr(x, 'tag', None) and x.tag.rpartition('}')[-1] in {'img', 'svg'}:
if hasattr(getattr(x, 'tag', None), 'rpartition') and x.tag.rpartition('}')[-1] in {'img', 'svg'}:
return False
if isspace(getattr(x, 'text', None)) and (x in ancestors or isspace(getattr(x, 'tail', None))):
continue