diff options
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/mandoc/html.c | 4 | ||||
-rw-r--r-- | usr.bin/mandoc/html.h | 4 | ||||
-rw-r--r-- | usr.bin/mandoc/man_html.c | 3 | ||||
-rw-r--r-- | usr.bin/mandoc/mdoc_html.c | 22 | ||||
-rw-r--r-- | usr.bin/mandoc/tbl_html.c | 7 |
5 files changed, 22 insertions, 18 deletions
diff --git a/usr.bin/mandoc/html.c b/usr.bin/mandoc/html.c index 12bcfbb7de4..f67f3a5b02a 100644 --- a/usr.bin/mandoc/html.c +++ b/usr.bin/mandoc/html.c @@ -1,4 +1,4 @@ -/* $OpenBSD: html.c,v 1.74 2017/01/29 14:02:19 schwarze Exp $ */ +/* $OpenBSD: html.c,v 1.75 2017/02/05 18:13:28 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011-2015, 2017 Ingo Schwarze <schwarze@openbsd.org> @@ -63,7 +63,7 @@ static const struct htmldata htmltags[TAG_MAX] = { {"br", HTML_NOSTACK | HTML_AUTOCLOSE | HTML_NLALL}, {"a", 0}, {"table", HTML_NLALL | HTML_INDENT}, - {"tbody", HTML_NLALL | HTML_INDENT}, + {"colgroup", HTML_NLALL | HTML_INDENT}, {"col", HTML_NOSTACK | HTML_AUTOCLOSE | HTML_NLALL}, {"tr", HTML_NLALL | HTML_INDENT}, {"td", HTML_NLAROUND}, diff --git a/usr.bin/mandoc/html.h b/usr.bin/mandoc/html.h index 22d0ced1357..cc0523a0984 100644 --- a/usr.bin/mandoc/html.h +++ b/usr.bin/mandoc/html.h @@ -1,4 +1,4 @@ -/* $OpenBSD: html.h,v 1.42 2017/01/29 14:02:19 schwarze Exp $ */ +/* $OpenBSD: html.h,v 1.43 2017/02/05 18:13:28 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org> @@ -30,7 +30,7 @@ enum htmltag { TAG_BR, TAG_A, TAG_TABLE, - TAG_TBODY, + TAG_COLGROUP, TAG_COL, TAG_TR, TAG_TD, diff --git a/usr.bin/mandoc/man_html.c b/usr.bin/mandoc/man_html.c index 057f01bf226..b41e3c056a0 100644 --- a/usr.bin/mandoc/man_html.c +++ b/usr.bin/mandoc/man_html.c @@ -1,4 +1,4 @@ -/* $OpenBSD: man_html.c,v 1.85 2017/01/30 20:23:07 schwarze Exp $ */ +/* $OpenBSD: man_html.c,v 1.86 2017/02/05 18:13:28 schwarze Exp $ */ /* * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2013, 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org> @@ -372,7 +372,6 @@ man_root_pre(MAN_ARGS) mandoc_asprintf(&title, "%s(%s)", man->title, man->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"); 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) { diff --git a/usr.bin/mandoc/tbl_html.c b/usr.bin/mandoc/tbl_html.c index f645f462b00..38515498c25 100644 --- a/usr.bin/mandoc/tbl_html.c +++ b/usr.bin/mandoc/tbl_html.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tbl_html.c,v 1.14 2017/01/17 01:47:46 schwarze Exp $ */ +/* $OpenBSD: tbl_html.c,v 1.15 2017/02/05 18:13:28 schwarze Exp $ */ /* * Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org> @@ -48,6 +48,7 @@ html_tbl_strlen(const char *p, void *arg) static void html_tblopen(struct html *h, const struct tbl_span *sp) { + struct tag *t; int ic; if (h->tbl.cols == NULL) { @@ -59,10 +60,10 @@ html_tblopen(struct html *h, const struct tbl_span *sp) assert(NULL == h->tblt); h->tblt = print_otag(h, TAG_TABLE, "c", "tbl"); + t = print_otag(h, TAG_COLGROUP, ""); for (ic = 0; ic < sp->opts->cols; ic++) print_otag(h, TAG_COL, "shw", h->tbl.cols[ic].width); - - print_otag(h, TAG_TBODY, ""); + print_tagq(h, t); } void |