summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2018-06-25 13:45:57 +0000
committerIngo Schwarze <schwarze@openbsd.org>2018-06-25 13:45:57 +0000
commite1b0237d058a55d8d44948a2d1990bded5a80480 (patch)
treef7e15d0b3a74742cac2996d96a93314da4276dcd
parent17ce74870dba4baa99844b39ca2f449d591b3fb5 (diff)
downloadmandoc-e1b0237d058a55d8d44948a2d1990bded5a80480.tar.gz
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--html.c2
-rw-r--r--html.h2
-rw-r--r--mdoc_html.c22
-rw-r--r--tbl_html.c9
4 files changed, 1 insertions, 34 deletions
diff --git a/html.c b/html.c
index 620d00b9..818c41b4 100644
--- a/html.c
+++ b/html.c
@@ -69,8 +69,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/html.h b/html.h
index b6d411f6..06d56fe9 100644
--- a/html.h
+++ b/html.h
@@ -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/mdoc_html.c b/mdoc_html.c
index f9f6b84b..2f2097b5 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -750,39 +750,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/tbl_html.c b/tbl_html.c
index 38fd777b..d7328e55 100644
--- a/tbl_html.c
+++ b/tbl_html.c
@@ -79,23 +79,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