From b20088191e3bcff195f7edd79644db484d2b71ac Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 8 Nov 2014 16:56:39 +0530 Subject: [PATCH] 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) --- src/calibre/ebooks/oeb/transforms/flatcss.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/oeb/transforms/flatcss.py b/src/calibre/ebooks/oeb/transforms/flatcss.py index 2bd300beab..b736458a87 100644 --- a/src/calibre/ebooks/oeb/transforms/flatcss.py +++ b/src/calibre/ebooks/oeb/transforms/flatcss.py @@ -474,7 +474,7 @@ class CSSFlattener(object): # 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() + klass = ascii_text(STRIPNUM.sub('', classes.split()[0])).lower().strip().replace(' ', '_') if css in styles: match = styles[css] else: