From a4e1608773e41b082d75ff2cbf2d56d12f5f02a1 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Thu, 10 Jan 2019 07:40:10 +0000 Subject: After years of gnashing of teeth, i finally found a way to avoid having to write empty list elements for non-compact .Bl -tag lists: 1. Add margin-bottom to the
. Note that margin-top on the
doesn't work because it would put a short
lower than the
; margin-bottom on the
doesn't work because it would put vertical space before the
for a long
; and margin-top on the
doesn't work because it would put a short
higher than the
. Only margin-bottom on the
has none of these adverse effects. 2. Of course, margin-bottom on the
fails to take care of the vertical spacing before the first list element, so implement that separately by margin-top on the
. 3. For .Bl -tag -compact, reset both to zero. --- mandoc.css | 9 +++++++-- mdoc_html.c | 14 +------------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/mandoc.css b/mandoc.css index 894c224a..db17e9de 100644 --- a/mandoc.css +++ b/mandoc.css @@ -1,4 +1,4 @@ -/* $Id: mandoc.css,v 1.42 2018/12/04 06:11:49 schwarze Exp $ */ +/* $Id: mandoc.css,v 1.43 2019/01/10 07:40:10 schwarze Exp $ */ /* * Standard style sheet for mandoc(1) -Thtml and man.cgi(8). * @@ -119,7 +119,8 @@ td.foot-os { text-align: right; } .Bl-ohang > dt { } .Bl-ohang > dd { margin-left: 0em; } -.Bl-tag { margin-left: 5.5em; } +.Bl-tag { margin-top: 0.6em; + margin-left: 5.5em; } .Bl-tag > dt { float: left; margin-top: 0em; @@ -131,8 +132,12 @@ td.foot-os { text-align: right; } width: 100%; margin-top: 0em; margin-left: 0em; + margin-bottom: 0.6em; vertical-align: top; overflow: auto; } +.Bl-compact { margin-top: 0em; } +.Bl-compact > dd { + margin-bottom: 0em; } .Bl-compact > dt { margin-top: 0em; } diff --git a/mdoc_html.c b/mdoc_html.c index 2978f0c8..08a2dc82 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.323 2019/01/07 07:26:29 schwarze Exp $ */ +/* $Id: mdoc_html.c,v 1.324 2019/01/10 07:40:10 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2014,2015,2016,2017,2018 Ingo Schwarze @@ -741,7 +741,6 @@ static int mdoc_it_pre(MDOC_ARGS) { const struct roff_node *bl; - struct tag *t; enum mdoc_list type; bl = n->parent; @@ -783,17 +782,6 @@ mdoc_it_pre(MDOC_ARGS) case LIST_tag: switch (n->type) { case ROFFT_HEAD: - if (h->style != NULL && !bl->norm->Bl.comp && - (n->parent->prev == NULL || - n->parent->prev->body == NULL || - n->parent->prev->body->child != NULL)) { - t = print_otag(h, TAG_DT, ""); - print_text(h, "\\ "); - print_tagq(h, t); - t = print_otag(h, TAG_DD, ""); - print_text(h, "\\ "); - print_tagq(h, t); - } print_otag(h, TAG_DT, ""); break; case ROFFT_BODY: -- cgit v1.2.3-56-ge451