mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #512
This commit is contained in:
parent
50c484fc35
commit
114feb3630
@ -93,6 +93,10 @@ class TOC(list):
|
|||||||
if not os.path.isabs(toc):
|
if not os.path.isabs(toc):
|
||||||
toc = os.path.join(cwd, toc)
|
toc = os.path.join(cwd, toc)
|
||||||
try:
|
try:
|
||||||
|
if not os.path.exists(toc):
|
||||||
|
bn = os.path.basename(toc)
|
||||||
|
bn = bn.replace('_top.htm', '_toc.htm') # Bug in BAEN OPF files
|
||||||
|
toc = os.path.join(os.path.dirname(toc), bn)
|
||||||
soup = BeautifulSoup(open(toc, 'rb').read(), convertEntities=BeautifulSoup.HTML_ENTITIES)
|
soup = BeautifulSoup(open(toc, 'rb').read(), convertEntities=BeautifulSoup.HTML_ENTITIES)
|
||||||
for a in soup.findAll('a'):
|
for a in soup.findAll('a'):
|
||||||
if not a.has_key('href'):
|
if not a.has_key('href'):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user