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:
Kovid Goyal 2018-02-23 08:29:51 +05:30
parent fa2bcb0f90
commit 8601b46151
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 18 additions and 0 deletions

View File

@ -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;
} }

View File

@ -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