From a629e4b5a755698809e4258622bc293b4d798d67 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 9 Jul 2014 12:33:38 +0530 Subject: [PATCH] Edit book/Book polishing: Preserve the class attribute on the tag in AZW3 format files. Fixes #1339055 [text layout changed from vertical to horizontal when using "Polish Books" feature](https://bugs.launchpad.net/calibre/+bug/1339055) --- src/calibre/ebooks/mobi/writer8/skeleton.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/calibre/ebooks/mobi/writer8/skeleton.py b/src/calibre/ebooks/mobi/writer8/skeleton.py index c0bc2d64c1..45282b56fd 100644 --- a/src/calibre/ebooks/mobi/writer8/skeleton.py +++ b/src/calibre/ebooks/mobi/writer8/skeleton.py @@ -218,6 +218,8 @@ class Chunker(object): # preceding layers should have removed svg and any other non html # namespaced tags. attrib = {'lang':lang} if lang else {} + if 'class' in root.attrib: + attrib['class'] = root.attrib['class'] nroot = etree.Element('html', attrib=attrib) nroot.text = root.text nroot.tail = '\n'