GNOME Bugzilla – Bug 769343
ssconvert produces not so great HTML when exporting multiple sheets
Last modified: 2016-08-04 20:56:38 UTC
This is with the html_range exporter. We get HTML of the form: <p><table> ... </table> <p><table> ... </table> I.e., the <p> tag is not closed. This causes problems when attempting to include this sort of output in XHTML files. It works perfectly well with just one sheet. In particular, this causes problems when trying to use ssconvert as a converter with LyX when producing XHTML output.
If you want xhtml output you should use "-E Gnumeric_html:xhtml" and you will get <p /><table> ... </table> so the <p> is closed in this case. That said, we should probably close the <p> in the plain html case.
Andreas, do you have any idea why the "p" handling is as it is? Other than maybe for really old html I would guess we would want to do <p><table ...>...</table></p> switch (version) { case HTML40: gsf_output_puts (output, "<p><table cellspacing=\"0\" cellpadding=\"3\">\n"); break; case XHTML: gsf_output_puts (output, "<p /><table cellspacing=\"0\" cellpadding=\"3\">\n"); break; default: gsf_output_puts (output, "<p><table border=\"1\">\n"); break; }
I don't recall why we did it this way, but I see nothing wrong with <p><table ...>...</table></p>
(In reply to Morten Welinder from comment #1) > If you want xhtml output you should use "-E Gnumeric_html:xhtml" The reason we need to use Gnumeric_html:html40frag is that we want just the table, not a complete document. (We embed the output in a larger document.) Both Gnumeric_html:xhtml and Gnumeric_html:xhtml_range give a complete document (with <html>, <head>, etc). Thanks for the attention to this.
The W3C validator for HTML 4.01 strict does not like: <p><table ...>...</table></p> It thinks P is no longer open when it runs into </p>. That validator also does not like <br>, <br /> or <p /> to separate the tables. THis pretty much explains why we have the code as it is.
This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.
Thanks very much.