mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-29 22:03:06 +02:00
ga - Corrects more parsing edge cases (issue 136)
This commit is contained in:
parent
840ca8092b
commit
159d081456
1 changed files with 2 additions and 2 deletions
|
|
@ -259,14 +259,14 @@ def parse_index(self):
|
|||
h2 = toc.find('h2')
|
||||
if h1.find('a') is not None and h1.find('a').contents is not None:
|
||||
title = h1.find('a').contents[0].strip()
|
||||
elif h1.contents[0] is not None:
|
||||
elif len(h1.contents) > 0 and h1.contents[0] is not None:
|
||||
title = h1.contents[0]
|
||||
else:
|
||||
title = ''
|
||||
if h2.find('a') is not None and h2.find('a').contents is not None:
|
||||
author = h2.find('a').contents[0].strip()
|
||||
title = title + u' (%s)' % author
|
||||
elif h2.contents[0] is not None:
|
||||
elif len(h2.contents) > 0 and h2.contents[0] is not None:
|
||||
author = h2.contents[0]
|
||||
title = title + u' (%s)' % author
|
||||
else:
|
||||
|
|
|
|||
Loading…
Reference in a new issue