summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/mdoc_html.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2017-02-05 18:13:28 +0000
committerschwarze <schwarze@openbsd.org>2017-02-05 18:13:28 +0000
commit408a904e46111407bd4200bd57a82d68d30e7daa (patch)
tree1ad2a2a7bd1ada2d9dca3157c515024a304bdaa3 /usr.bin/mandoc/mdoc_html.c
parentAlways allocate counters memory using type M_COUNTERS. (diff)
downloadwireguard-openbsd-408a904e46111407bd4200bd57a82d68d30e7daa.tar.xz
wireguard-openbsd-408a904e46111407bd4200bd57a82d68d30e7daa.zip
Improve <table> syntax:
The <col> element can only appear inside <colgroup>, so use <colgroup>. The <tbody> element is optional and useless, so don't use it. Even if we would ever need <thead> or <tfoot>, <tbody> would still be optional and useless; besides, we will likely never need <thead> or <tfoot>, simply because our languages don't support such functionality.
Diffstat (limited to 'usr.bin/mandoc/mdoc_html.c')
-rw-r--r--usr.bin/mandoc/mdoc_html.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/usr.bin/mandoc/mdoc_html.c b/usr.bin/mandoc/mdoc_html.c
index 69440dbcb91..3eeaa797d60 100644
--- a/usr.bin/mandoc/mdoc_html.c
+++ b/usr.bin/mandoc/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mdoc_html.c,v 1.139 2017/01/29 14:02:19 schwarze Exp $ */
+/* $OpenBSD: mdoc_html.c,v 1.140 2017/02/05 18:13:28 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -426,7 +426,6 @@ mdoc_root_post(MDOC_ARGS)
struct tag *t, *tt;
t = print_otag(h, TAG_TABLE, "c", "foot");
- print_otag(h, TAG_TBODY, "");
tt = print_otag(h, TAG_TR, "");
print_otag(h, TAG_TD, "c", "foot-date");
@@ -457,7 +456,6 @@ mdoc_root_pre(MDOC_ARGS)
meta->title, meta->msec);
t = print_otag(h, TAG_TABLE, "c", "head");
- print_otag(h, TAG_TBODY, "");
tt = print_otag(h, TAG_TR, "");
print_otag(h, TAG_TD, "c", "head-ltitle");
@@ -572,6 +570,7 @@ mdoc_nd_pre(MDOC_ARGS)
static int
mdoc_nm_pre(MDOC_ARGS)
{
+ struct tag *t;
int len;
switch (n->type) {
@@ -600,9 +599,10 @@ mdoc_nm_pre(MDOC_ARGS)
if (len == 0 && meta->name != NULL)
len = html_strlen(meta->name);
+ t = print_otag(h, TAG_COLGROUP, "");
print_otag(h, TAG_COL, "shw", len);
print_otag(h, TAG_COL, "");
- print_otag(h, TAG_TBODY, "");
+ print_tagq(h, t);
print_otag(h, TAG_TR, "");
return 1;
}
@@ -799,6 +799,7 @@ mdoc_it_pre(MDOC_ARGS)
static int
mdoc_bl_pre(MDOC_ARGS)
{
+ struct tag *t;
struct mdoc_bl *bl;
const char *cattr;
size_t i;
@@ -806,13 +807,11 @@ mdoc_bl_pre(MDOC_ARGS)
bl = &n->norm->Bl;
- if (n->type == ROFFT_BODY) {
- if (bl->type == LIST_column)
- print_otag(h, TAG_TBODY, "");
+ switch (n->type) {
+ case ROFFT_BODY:
return 1;
- }
- if (n->type == ROFFT_HEAD) {
+ case ROFFT_HEAD:
if (bl->type != LIST_column || bl->ncols == 0)
return 0;
@@ -823,10 +822,15 @@ mdoc_bl_pre(MDOC_ARGS)
* screen and we want to preserve that behaviour.
*/
+ t = print_otag(h, TAG_COLGROUP, "");
for (i = 0; i < bl->ncols - 1; i++)
print_otag(h, TAG_COL, "sww", bl->cols[i]);
print_otag(h, TAG_COL, "swW", bl->cols[i]);
+ print_tagq(h, t);
return 0;
+
+ default:
+ break;
}
switch (bl->type) {