mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-01 14:44:29 +02:00
EPUB Output:Remove object and embed tags when using profile PRS505 as they cause the reader to crash
This commit is contained in:
parent
e10146e56d
commit
757d9a533f
2 changed files with 10 additions and 4 deletions
|
|
@ -15,15 +15,17 @@
|
|||
|
||||
class DefaultProfile(object):
|
||||
|
||||
flow_size = sys.maxint
|
||||
screen_size = None
|
||||
flow_size = sys.maxint
|
||||
screen_size = None
|
||||
remove_special_chars = False
|
||||
remove_object_tags = False
|
||||
|
||||
class PRS505(DefaultProfile):
|
||||
|
||||
flow_size = 270000
|
||||
screen_size = (590, 765)
|
||||
flow_size = 270000
|
||||
screen_size = (590, 765)
|
||||
remove_special_chars = re.compile(u'[\u200b\u00ad]')
|
||||
remove_object_tags = True
|
||||
|
||||
|
||||
PROFILES = {
|
||||
|
|
|
|||
|
|
@ -158,6 +158,10 @@ def fix_markup(self):
|
|||
for br in self.body.xpath('./br'):
|
||||
br.tag = 'p'
|
||||
br.text = u'\u00a0'
|
||||
|
||||
if self.opts.profile.remove_object_tags:
|
||||
for tag in self.root.xpath('//object|//embed'):
|
||||
tag.getparent().remove(tag)
|
||||
|
||||
def save(self):
|
||||
for meta in list(self.root.xpath('//meta')):
|
||||
|
|
|
|||
Loading…
Reference in a new issue