Edit book/Book polishing: Preserve the class attribute on the <html> 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)

This commit is contained in:
Kovid Goyal 2014-07-09 12:33:38 +05:30
parent 7d524da902
commit a629e4b5a7

View File

@ -218,6 +218,8 @@ class Chunker(object):
# preceding layers should have removed svg and any other non html # preceding layers should have removed svg and any other non html
# namespaced tags. # namespaced tags.
attrib = {'lang':lang} if lang else {} attrib = {'lang':lang} if lang else {}
if 'class' in root.attrib:
attrib['class'] = root.attrib['class']
nroot = etree.Element('html', attrib=attrib) nroot = etree.Element('html', attrib=attrib)
nroot.text = root.text nroot.text = root.text
nroot.tail = '\n' nroot.tail = '\n'