Skip to content

Commit

Permalink
Merge branch 'yshalsager-patch-1'
Browse files Browse the repository at this point in the history
  • Loading branch information
aerkalov committed Dec 10, 2022
2 parents 7edc258 + bff61b3 commit a55089a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ebooklib/epub.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,8 +496,8 @@ class EpubNav(EpubHtml):
Represents Navigation Document in the EPUB file.
"""

def __init__(self, uid='nav', file_name='nav.xhtml', media_type='application/xhtml+xml', title=''):
super(EpubNav, self).__init__(uid=uid, file_name=file_name, media_type=media_type, title=title)
def __init__(self, uid='nav', file_name='nav.xhtml', media_type='application/xhtml+xml', title='', direction=None):
super(EpubNav, self).__init__(uid=uid, file_name=file_name, media_type=media_type, title=title, direction=direction)

def is_chapter(self):
"""
Expand Down Expand Up @@ -1133,6 +1133,8 @@ def _get_nav(self, item):
})

body = etree.SubElement(root, 'body')
if item.direction:
body.set('dir', item.direction)
nav = etree.SubElement(body, 'nav', {
'{%s}type' % NAMESPACES['EPUB']: 'toc',
'id': 'id',
Expand Down

0 comments on commit a55089a

Please sign in to comment.