This commit is contained in:
Kovid Goyal 2014-09-02 14:31:53 +05:30
parent 134184eb1d
commit 8d0689eda1

View File

@ -463,6 +463,9 @@ class CSSFlattener(object):
items = sorted(cssdict.iteritems())
css = u';\n'.join(u'%s: %s' % (key, val) for key, val in items)
classes = node.get('class', '').strip() or 'calibre'
# lower() because otherwise if the document uses the same class
# name with different case, both cases will apply, leading
# to incorrect results.
klass = ascii_text(STRIPNUM.sub('', classes.split()[0])).lower()
if css in styles:
match = styles[css]