mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Fix #3803 (mobi/prc > epub conversion failure)
This commit is contained in:
parent
0df1b1e3b0
commit
220b49f1d7
@ -489,6 +489,9 @@ class MobiReader(object):
|
|||||||
mobi_version = self.book_header.mobi_version
|
mobi_version = self.book_header.mobi_version
|
||||||
for i, tag in enumerate(root.iter(etree.Element)):
|
for i, tag in enumerate(root.iter(etree.Element)):
|
||||||
tag.attrib.pop('xmlns', '')
|
tag.attrib.pop('xmlns', '')
|
||||||
|
for x in tag.attrib:
|
||||||
|
if ':' in x:
|
||||||
|
del tag.attrib[x]
|
||||||
if tag.tag in ('country-region', 'place', 'placetype', 'placename',
|
if tag.tag in ('country-region', 'place', 'placetype', 'placename',
|
||||||
'state', 'city', 'street', 'address', 'content'):
|
'state', 'city', 'street', 'address', 'content'):
|
||||||
tag.tag = 'div' if tag.tag == 'content' else 'span'
|
tag.tag = 'div' if tag.tag == 'content' else 'span'
|
||||||
|
@ -140,8 +140,8 @@ class PostInstall:
|
|||||||
for f in os.listdir('.'):
|
for f in os.listdir('.'):
|
||||||
if os.stat(f).st_uid == 0:
|
if os.stat(f).st_uid == 0:
|
||||||
os.rmdir(f) if os.path.isdir(f) else os.unlink(f)
|
os.rmdir(f) if os.path.isdir(f) else os.unlink(f)
|
||||||
if os.stat(config_dir).st_uid == 0:
|
if os.stat(config_dir).st_uid == 0:
|
||||||
os.rmdir(config_dir)
|
os.rmdir(config_dir)
|
||||||
|
|
||||||
if warn is None and self.warnings:
|
if warn is None and self.warnings:
|
||||||
self.info('There were %d warnings'%len(self.warnings))
|
self.info('There were %d warnings'%len(self.warnings))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user