-put_tfoot (struct html_driver *html, const struct table *t, bool *tfoot)
-{
- if (!*tfoot)
- {
- fputs ("<tfoot>\n", html->file);
- fputs ("<tr>\n", html->file);
- fprintf (html->file, "<td colspan=%d>\n", t->n[H]);
- *tfoot = true;
- }
- else
- fputs ("\n<br>", html->file);
-}
-
-static void
-html_put_footnote_markers (struct html_driver *html,
- struct footnote **footnotes,
- size_t n_footnotes)
-{
- if (n_footnotes > 0)
- {
- fputs ("<sup>", html->file);
- for (size_t i = 0; i < n_footnotes; i++)
- {
- const struct footnote *f = footnotes[i];
-
- if (i > 0)
- putc (',', html->file);
- escape_string (html->file, f->marker, " ", "<br>");
- }
- fputs ("</sup>", html->file);
- }
-}
-
-static void
-html_put_table_cell_text (struct html_driver *html,
- const struct table_cell *cell)
-{
- const char *s = cell->text;
- if (cell->options & TAB_FIX)
- escape_tag (html->file, "tt", s, " ", "<br>");
- else
- {
- s += strspn (s, CC_SPACES);
- escape_string (html->file, s, " ", "<br>");
- }
-
- if (cell->n_subscripts)
- {
- fputs ("<sub>", html->file);
- for (size_t i = 0; i < cell->n_subscripts; i++)
- {
- if (i)
- putc (',', html->file);
- escape_string (html->file, cell->subscripts[i],
- " ", "<br>");
- }
- fputs ("</sub>", html->file);
- }
- html_put_footnote_markers (html, cell->footnotes, cell->n_footnotes);
-}
-
-static void
-html_put_table_item_layers (struct html_driver *html,
- const struct table_item_layers *layers)
-{
- for (size_t i = 0; i < layers->n_layers; i++)
- {
- if (i)
- fputs ("<br>\n", html->file);
-
- const struct table_item_layer *layer = &layers->layers[i];
- escape_string (html->file, layer->content, " ", "<br>");
- html_put_footnote_markers (html, layer->footnotes, layer->n_footnotes);
- }
-}
-
-static void
-html_put_table_cell (struct html_driver *html, const struct table *t,
- const struct table_cell *cell, const char *tag,
- bool border)