summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2018-06-25 13:46:01 +0000
committerschwarze <schwarze@openbsd.org>2018-06-25 13:46:01 +0000
commit7056f56a7cbbc71dcc3a5447577fac4bb3d3654f (patch)
tree78ea423a541f5f72ed37849e4509dd8eeecb4518
parentIgnore author-specified indentation for .RS; it harms responsive (diff)
downloadwireguard-openbsd-7056f56a7cbbc71dcc3a5447577fac4bb3d3654f.tar.xz
wireguard-openbsd-7056f56a7cbbc71dcc3a5447577fac4bb3d3654f.zip
Do not write <colgroup> elements. Their only purpose is to enforce
author-specified column widths, which can harm responsive design and provide no real benefit: HTML rendering engines usually do just fine automatically selecting appropriate column widths.
-rw-r--r--usr.bin/mandoc/html.c4
-rw-r--r--usr.bin/mandoc/html.h4
-rw-r--r--usr.bin/mandoc/mdoc_html.c24
-rw-r--r--usr.bin/mandoc/tbl_html.c11
4 files changed, 5 insertions, 38 deletions
diff --git a/usr.bin/mandoc/html.c b/usr.bin/mandoc/html.c
index 108d692dfe2..5bbd8d5edab 100644
--- a/usr.bin/mandoc/html.c
+++ b/usr.bin/mandoc/html.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: html.c,v 1.104 2018/06/25 13:26:53 schwarze Exp $ */
+/* $OpenBSD: html.c,v 1.105 2018/06/25 13:46:01 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -67,8 +67,6 @@ static const struct htmldata htmltags[TAG_MAX] = {
{"br", HTML_NOSTACK | HTML_AUTOCLOSE | HTML_NLALL},
{"a", 0},
{"table", HTML_NLALL | HTML_INDENT},
- {"colgroup", HTML_NLALL | HTML_INDENT},
- {"col", HTML_NOSTACK | HTML_AUTOCLOSE | HTML_NLALL},
{"tr", HTML_NLALL | HTML_INDENT},
{"td", HTML_NLAROUND},
{"li", HTML_NLAROUND | HTML_INDENT},
diff --git a/usr.bin/mandoc/html.h b/usr.bin/mandoc/html.h
index 7768fb99f43..e544d18c416 100644
--- a/usr.bin/mandoc/html.h
+++ b/usr.bin/mandoc/html.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: html.h,v 1.52 2018/05/25 20:23:39 schwarze Exp $ */
+/* $OpenBSD: html.h,v 1.53 2018/06/25 13:46:01 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -31,8 +31,6 @@ enum htmltag {
TAG_BR,
TAG_A,
TAG_TABLE,
- TAG_COLGROUP,
- TAG_COL,
TAG_TR,
TAG_TD,
TAG_LI,
diff --git a/usr.bin/mandoc/mdoc_html.c b/usr.bin/mandoc/mdoc_html.c
index f57f29092d4..789b8da21d5 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.181 2018/06/10 16:15:40 schwarze Exp $ */
+/* $OpenBSD: mdoc_html.c,v 1.182 2018/06/25 13:46:01 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014,2015,2016,2017,2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -748,39 +748,19 @@ static int
mdoc_bl_pre(MDOC_ARGS)
{
char cattr[28];
- struct tag *t;
struct mdoc_bl *bl;
- size_t i;
enum htmltag elemtype;
- bl = &n->norm->Bl;
-
switch (n->type) {
case ROFFT_BODY:
return 1;
-
case ROFFT_HEAD:
- if (bl->type != LIST_column || bl->ncols == 0)
- return 0;
-
- /*
- * For each column, print out the <COL> tag with our
- * suggested width. The last column gets min-width, as
- * in terminal mode it auto-sizes to the width of the
- * 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, "sw+w", bl->cols[i]);
- print_otag(h, TAG_COL, "swW", bl->cols[i]);
- print_tagq(h, t);
return 0;
-
default:
break;
}
+ bl = &n->norm->Bl;
switch (bl->type) {
case LIST_bullet:
elemtype = TAG_UL;
diff --git a/usr.bin/mandoc/tbl_html.c b/usr.bin/mandoc/tbl_html.c
index 0d2582f1c1b..64679ec8f80 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.18 2017/07/31 16:14:04 schwarze Exp $ */
+/* $OpenBSD: tbl_html.c,v 1.19 2018/06/25 13:46:01 schwarze Exp $ */
/*
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -77,23 +77,14 @@ html_tbl_sulen(const struct roffsu *su, void *arg)
static void
html_tblopen(struct html *h, const struct tbl_span *sp)
{
- struct tag *t;
- int ic;
-
if (h->tbl.cols == NULL) {
h->tbl.len = html_tbl_len;
h->tbl.slen = html_tbl_strlen;
h->tbl.sulen = html_tbl_sulen;
tblcalc(&h->tbl, sp, 0, 0);
}
-
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_tagq(h, t);
}
void