E-book viewer: Fix a regression, caused by a Qt 5 behavior change, that caused incorrect colors to be shown when viewing MOBI files that use CSS 3 color specifications internally.

This commit is contained in:
Kovid Goyal 2014-09-28 11:37:13 +05:30
parent e878b52c99
commit 384542e030

View File

@ -513,6 +513,11 @@ class MobiReader(object):
'div' and 'filepos-id' in attrib):
pagebreak_anchors.append(tag)
if 'color' in attrib:
styles.append('color: ' + attrib.pop('color'))
if 'bgcolor' in attrib:
styles.append('background-color: ' + attrib.pop('bgcolor'))
if 'filepos-id' in attrib:
attrib['id'] = attrib.pop('filepos-id')
if 'name' in attrib and attrib['name'] != attrib['id']: