Conversion: Fix incorrect conversion of east-asian characters in CSS class names. Fixes #1390527 [lost the style's names when converting to another format](https://bugs.launchpad.net/calibre/+bug/1390527)

This commit is contained in:
Kovid Goyal 2014-11-08 16:56:39 +05:30
parent e6f4c169d9
commit b20088191e

View File

@ -474,7 +474,7 @@ class CSSFlattener(object):
# lower() because otherwise if the document uses the same class # lower() because otherwise if the document uses the same class
# name with different case, both cases will apply, leading # name with different case, both cases will apply, leading
# to incorrect results. # to incorrect results.
klass = ascii_text(STRIPNUM.sub('', classes.split()[0])).lower() klass = ascii_text(STRIPNUM.sub('', classes.split()[0])).lower().strip().replace(' ', '_')
if css in styles: if css in styles:
match = styles[css] match = styles[css]
else: else: