diff --git a/src/calibre/srv/render_book.py b/src/calibre/srv/render_book.py index af05359d4d..c618b4bb6f 100644 --- a/src/calibre/srv/render_book.py +++ b/src/calibre/srv/render_book.py @@ -454,7 +454,9 @@ def map_epub_type(epub_type, attribs, elem): if in_attribs is None: attribs.append(['role', role]) else: - attribs[i] = ['role', role] + attribs[in_attribs] = ['role', role] + return True + return False known_tags = ('img', 'script', 'link', 'image', 'style')