In fact FB2 supports tables using <table>, <tr> and <td> tags, much like HTML. These tags should have appeared in the FB2 output rather than just <p> tags.

This problem was found in Calibre 2.45, running under Ubuntu 12.04.

Since the input was a proprietry format using a specially developed input conversion plugin, providing the input and output files would not be of use to you. The ebook-convert command line specified --debug-pipeline and the section of HTML quoted above is from one of the files in the input directory as written out during conversion.

Due to the lack of any progress on this bug in the last two months, I have had a look at the code myself. Attached is fb2ml.py with some changes I have made, for your consideration. I have tested my changes, and they seem to work fine. I have added handling for the HTML tags <table>, <tr>, <th> and <td>. Note that a table is not expected to be part of a paragraph, so I have had to make some changes to prevent <p> tags being generated when text in the table cells is encountered. I have not attempted to do anything more complicated like ensuring that a table is not within a paragraph, or that the table-related tags are correctly nested.

While I dont maintain the fb2 output code, so it is not possible for me to review your changes in general, one thing that I can say is that you can make it more general by check the value of style['display'] rather than tag names, since in html any tags can be made to behave like tables by setting the display property to 'table', 'table-row' and 'table-cell'.

Thank you for your comment. I have now updated the code to check for the appropriate values of style['display'] as well as as tag names.I have also moved the checks to before checks for bold, italics, etc. since if a table cell or row has a style which makes it bold or italics, it seems more natural to have the corresponding tag within <td> or <tr> rather than the other way round.

While I dont maintain the fb2 output code, so it is not possible for me
to review your changes in general, one thing that I can say is that you
can make it more general by check the value of style['display'] rather
than tag names, since in html any tags can be made to behave like tables
by setting the display property to 'table', 'table-row' and 'table-
cell'.

In fact FB2 supports tables using <table>, <tr> and <td> tags, much
like HTML. These tags should have appeared in the FB2 output rather
than just <p> tags.

This problem was found in Calibre 2.45, running under Ubuntu 12.04.

Since the input was a proprietry format using a specially developed
input conversion plugin, providing the input and output files would
not be of use to you. The ebook-convert command line specified
--debug-pipeline and the section of HTML quoted above is from one of
the files in the input directory as written out during conversion.