}
static void
-html_submit (struct output_driver *driver, const struct output_item *item)
+html_submit__ (struct output_driver *driver, const struct output_item *item,
+ int level)
{
struct html_driver *html = html_driver_cast (driver);
}
break;
- case OUTPUT_ITEM_GROUP_OPEN:
- break;
-
- case OUTPUT_ITEM_GROUP_CLOSE:
+ case OUTPUT_ITEM_GROUP:
+ for (size_t i = 0; i < item->group.n_children; i++)
+ html_submit__ (driver, item->group.children[i], level + 1);
break;
case OUTPUT_ITEM_IMAGE:
case TEXT_ITEM_TITLE:
{
- int level = MIN (5, output_get_group_level ()) + 1;
- char tag[3] = { 'H', level + '1', '\0' };
+ char tag[3] = { 'H', MIN (5, level) + '0', '\0' };
print_title_tag (html->file, tag, s);
}
break;
}
}
+static void
+html_submit (struct output_driver *driver, const struct output_item *item)
+{
+ html_submit__ (driver, item, 1);
+}
+
/* Write TEXT to file F, escaping characters as necessary for HTML. Spaces are
replaced by SPACE, which should be " " or " " New-lines are replaced by
NEWLINE, which might be "<BR>" or "\n" or something else appropriate. */
static const struct output_driver_class html_driver_class =
{
- "html",
- html_destroy,
- html_submit,
- NULL,
+ .name = "html",
+ .destroy = html_destroy,
+ .submit = html_submit,
+ .handles_groups = true,
};