Fix #3876 (UnicodeDecodeError while converting from HTML to EPUB)

This commit is contained in:
Kovid Goyal 2009-10-30 14:18:11 -06:00
parent f2c448bb56
commit d3ef167774

View File

@ -6,14 +6,14 @@ __license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>' __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en' __docformat__ = 'restructuredtext en'
from calibre.ebooks.oeb.base import OEB_DOCS, XPath from calibre.ebooks.oeb.base import OEB_DOCS, XPath, XHTML
class LinearizeTables(object): class LinearizeTables(object):
def linearize(self, root): def linearize(self, root):
for x in XPath('//h:table|//h:td|//h:tr|//h:th|//h:caption|' for x in XPath('//h:table|//h:td|//h:tr|//h:th|//h:caption|'
'//h:tbody|//h:tfoot|//h:thead|//h:colgroup|//h:col')(root): '//h:tbody|//h:tfoot|//h:thead|//h:colgroup|//h:col')(root):
x.tag = 'div' x.tag = XHTML('div')
for attr in ('style', 'font', 'valign', for attr in ('style', 'font', 'valign',
'colspan', 'width', 'height', 'colspan', 'width', 'height',
'rowspan', 'summary', 'align', 'rowspan', 'summary', 'align',