Quote:
Originally Posted by kovidgoyal
@darkom: That's pretty much what linearize_tables does currently
Code:
def linearize(self, root):
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):
x.tag = XHTML('div')
for attr in ('style', 'font', 'valign',
'colspan', 'width', 'height',
'rowspan', 'summary', 'align',
'cellspacing', 'cellpadding',
'frames', 'rules', 'border'):
if attr in x.attrib:
del x.attrib[attr]
|
Well something is not being done right. For example if you take boston.com recipe I just posted (which has tables), remove keep_only_tags and add linearize_tables options you will see that generated epub displays incorrectly in adobe DE. However if you add the part for removing tables I posted than generated epub displays correctly in adobe DE and in sony reader. I suggest you compare the output to see what is the difference and thus perhaps improve the code or something.