mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-31 14:33:54 -04:00
Conversion: Handle the deprecated type attribute on <ol> tags. Fixes #1751148 [Bad conversion <ol type="a"> from ePub to azw3](https://bugs.launchpad.net/calibre/+bug/1751148)
This commit is contained in:
parent
fa2bcb0f90
commit
8601b46151
@ -303,6 +303,22 @@ ol {
|
|||||||
margin: 1em 0;
|
margin: 1em 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ol[type="a"] {
|
||||||
|
list-style-type: lower-alpha;
|
||||||
|
}
|
||||||
|
|
||||||
|
ol[type="A"] {
|
||||||
|
list-style-type: upper-alpha;
|
||||||
|
}
|
||||||
|
|
||||||
|
ol[type="i"] {
|
||||||
|
list-style-type: lower-roman;
|
||||||
|
}
|
||||||
|
|
||||||
|
ol[type="I"] {
|
||||||
|
list-style-type: upper-roman;
|
||||||
|
}
|
||||||
|
|
||||||
li {
|
li {
|
||||||
display: list-item;
|
display: list-item;
|
||||||
}
|
}
|
||||||
|
@ -430,6 +430,8 @@ class CSSFlattener(object):
|
|||||||
except (ValueError, SyntaxErr):
|
except (ValueError, SyntaxErr):
|
||||||
pass
|
pass
|
||||||
del node.attrib['bgcolor']
|
del node.attrib['bgcolor']
|
||||||
|
if tag == 'ol' and 'type' in node.attrib:
|
||||||
|
del node.attrib['type']
|
||||||
if cssdict.get('font-weight', '').lower() == 'medium':
|
if cssdict.get('font-weight', '').lower() == 'medium':
|
||||||
cssdict['font-weight'] = 'normal' # ADE chokes on font-weight medium
|
cssdict['font-weight'] = 'normal' # ADE chokes on font-weight medium
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user