aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-02-05 18:15:39 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-02-05 18:15:39 +0000
commitc6e62f9888a3bce6f8b3f7a4ee028dbdfc01ab1f (patch)
tree5b001c4f9597be2aa5b561fe3d2bd93dae2735ec /mdoc_html.c
parent917cc472b6d91e5bac0a2f3cdf26e113a64ecd45 (diff)
downloadmandoc-c6e62f9888a3bce6f8b3f7a4ee028dbdfc01ab1f.tar.gz
mandoc-c6e62f9888a3bce6f8b3f7a4ee028dbdfc01ab1f.tar.zst
mandoc-c6e62f9888a3bce6f8b3f7a4ee028dbdfc01ab1f.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 'mdoc_html.c')
-rw-r--r--mdoc_html.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/mdoc_html.c b/mdoc_html.c
index b32aaaf3..9dc82953 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_html.c,v 1.264 2017/01/29 14:02:42 schwarze Exp $ */
+/* $Id: mdoc_html.c,v 1.265 2017/02/05 18:15:39 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -428,7 +428,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");
@@ -459,7 +458,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");
@@ -574,6 +572,7 @@ mdoc_nd_pre(MDOC_ARGS)
static int
mdoc_nm_pre(MDOC_ARGS)
{
+ struct tag *t;
int len;
switch (n->type) {
@@ -602,9 +601,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;
}
@@ -801,6 +801,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;
@@ -808,13 +809,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;
@@ -825,10 +824,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) {