mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Workaround for Adobe Digital Editions crashing when it encounters font-size: medium
This commit is contained in:
parent
bcf74965b5
commit
ee76cfef67
@ -39,6 +39,12 @@
|
|||||||
- title: "calibredb with output format stanza once again escapes URLs"
|
- title: "calibredb with output format stanza once again escapes URLs"
|
||||||
tickets: [4084]
|
tickets: [4084]
|
||||||
|
|
||||||
|
- title: Implement work around for a CSS bug in Adobe Digital Editions that causes it to crash
|
||||||
|
description: >
|
||||||
|
If the CSS contains the declaration font-size: medium instead of font-size: normal
|
||||||
|
Adobe Digital Editions will crash. calibre will now automatically replace medium with
|
||||||
|
normal.
|
||||||
|
|
||||||
- title: "PML Output: Only create \\a and \\U tags for supported characters."
|
- title: "PML Output: Only create \\a and \\U tags for supported characters."
|
||||||
|
|
||||||
- title: "PML Input: Allow for images in top-level bookname_image and images directories"
|
- title: "PML Input: Allow for images in top-level bookname_image and images directories"
|
||||||
|
@ -780,6 +780,8 @@ class Manifest(object):
|
|||||||
# In particular, it causes tostring to insert xmlns
|
# In particular, it causes tostring to insert xmlns
|
||||||
# declarations, which messes up the coercing logic
|
# declarations, which messes up the coercing logic
|
||||||
idx = data.find('<html')
|
idx = data.find('<html')
|
||||||
|
if idx == -1:
|
||||||
|
idx = data.find('<HTML')
|
||||||
if idx > -1:
|
if idx > -1:
|
||||||
pre = data[:idx]
|
pre = data[:idx]
|
||||||
data = data[idx:]
|
data = data[idx:]
|
||||||
|
@ -229,6 +229,8 @@ class CSSFlattener(object):
|
|||||||
if 'bgcolor' in node.attrib:
|
if 'bgcolor' in node.attrib:
|
||||||
cssdict['background-color'] = node.attrib['bgcolor']
|
cssdict['background-color'] = node.attrib['bgcolor']
|
||||||
del node.attrib['bgcolor']
|
del node.attrib['bgcolor']
|
||||||
|
if cssdict.get('font-weight', '').lower() == 'medium':
|
||||||
|
cssdict['font-weight'] = 'normal' # ADE chokes on font-weight medium
|
||||||
if not self.context.disable_font_rescaling:
|
if not self.context.disable_font_rescaling:
|
||||||
_sbase = self.sbase if self.sbase is not None else \
|
_sbase = self.sbase if self.sbase is not None else \
|
||||||
self.context.source.fbase
|
self.context.source.fbase
|
||||||
|
Loading…
x
Reference in New Issue
Block a user