Don't die on complex tables.

This commit is contained in:
Kovid Goyal 2007-08-06 04:54:49 +00:00
parent a456fa8f74
commit 1495b8c843

View File

@ -1226,7 +1226,12 @@ class HTMLConverter(object):
self.process_children(tag, tag_css) self.process_children(tag, tag_css)
elif tagname == 'table' and not self.ignore_tables and not self.in_table: elif tagname == 'table' and not self.ignore_tables and not self.in_table:
tag_css = self.tag_css(tag) # Table should not inherit CSS tag_css = self.tag_css(tag) # Table should not inherit CSS
self.process_table(tag, tag_css) try:
self.process_table(tag, tag_css)
except Exception, err:
print 'WARNING: An error occurred while processing a table:', err
print 'Ignoring table markup'
self.process_children(tag, tag_css)
else: else:
self.process_children(tag, tag_css) self.process_children(tag, tag_css)
if end_page: if end_page: