}
}
-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)
}
fputs ("</sub>", html->file);
}
- html_put_footnote_markers (html, cell->footnotes, cell->n_footnotes);
+ if (cell->n_footnotes > 0)
+ {
+ fputs ("<sup>", html->file);
+ for (size_t i = 0; i < cell->n_footnotes; i++)
+ {
+ if (i > 0)
+ putc (',', html->file);
+
+ char *marker = pivot_value_to_string (cell->footnotes[i]->marker,
+ SETTINGS_VALUE_SHOW_DEFAULT,
+ SETTINGS_VALUE_SHOW_DEFAULT);
+ escape_string (html->file, marker, " ", "<br>");
+ free (marker);
+ }
+ fputs ("</sup>", html->file);
+ }
}
static void
fputs ("</tr>\n", html->file);
}
- for (size_t y = 0; y < footnotes->n[V]; y++)
- {
- fputs ("<tr>\n", html->file);
+ if (footnotes)
+ for (size_t y = 0; y < footnotes->n[V]; y++)
+ {
+ fputs ("<tr>\n", html->file);
- struct table_cell cell;
- table_get_cell (footnotes, 0, y, &cell);
- cell.d[H][1] = body->n[H];
- html_put_table_cell (html, &cell, "td", NULL);
+ struct table_cell cell;
+ table_get_cell (footnotes, 0, y, &cell);
+ cell.d[H][1] = body->n[H];
+ html_put_table_cell (html, &cell, "td", NULL);
- fputs ("</tr>\n", html->file);
- }
+ fputs ("</tr>\n", html->file);
+ }
fputs ("</tfoot>\n", html->file);
}