mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #3876 (UnicodeDecodeError while converting from HTML to EPUB)
This commit is contained in:
parent
f2c448bb56
commit
d3ef167774
@ -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',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user