From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id c70e2303 for ; Sat, 15 Jul 2017 12:58:22 -0500 (EST) Date: Sat, 15 Jul 2017 12:58:22 -0500 (EST) Message-Id: <7111400366328984941.enqueue@fantadrom.bsd.lv> X-Mailinglist: mandoc-source Reply-To: source@mandoc.bsd.lv MIME-Version: 1.0 From: schwarze@mandoc.bsd.lv To: source@mandoc.bsd.lv Subject: mandoc: In .Bl -tag and -hang, do not print a margin-left style X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- In .Bl -tag and -hang, do not print a margin-left style attribute for each individual item if the -width argument matches the default of 6n. Suggested by Steffen Nurpmeso on in April 2017. Modified Files: -------------- mandoc: html.c mandoc_html.3 mdoc_html.c Revision Data ------------- Index: html.c =================================================================== RCS file: /home/cvs/mandoc/mandoc/html.c,v retrieving revision 1.218 retrieving revision 1.219 diff -Lhtml.c -Lhtml.c -u -p -r1.218 -r1.219 --- html.c +++ html.c @@ -624,24 +624,28 @@ print_otag(struct html *h, enum htmltag su = va_arg(ap, struct roffsu *); break; case 'w': - if ((arg2 = va_arg(ap, char *)) == NULL) { - if (*fmt == '+') - fmt++; - if (*fmt == '-') - fmt++; - break; + if ((arg2 = va_arg(ap, char *)) != NULL) { + su = &mysu; + a2width(arg2, su); + } + if (*fmt == '*') { + if (su != NULL && su->unit == SCALE_EN && + su->scale > 5.9 && su->scale < 6.1) + su = NULL; + fmt++; } - su = &mysu; - a2width(arg2, su); if (*fmt == '+') { - /* Increase to make even bold text fit. */ - su->scale *= 1.2; - /* Add padding. */ - su->scale += 3.0; + if (su != NULL) { + /* Make even bold text fit. */ + su->scale *= 1.2; + /* Add padding. */ + su->scale += 3.0; + } fmt++; } if (*fmt == '-') { - su->scale *= -1.0; + if (su != NULL) + su->scale *= -1.0; fmt++; } break; Index: mdoc_html.c =================================================================== RCS file: /home/cvs/mandoc/mandoc/mdoc_html.c,v retrieving revision 1.293 retrieving revision 1.294 diff -Lmdoc_html.c -Lmdoc_html.c -u -p -r1.293 -r1.294 --- mdoc_html.c +++ mdoc_html.c @@ -732,7 +732,7 @@ mdoc_it_pre(MDOC_ARGS) print_otag(h, TAG_B, "c", cattr); break; case ROFFT_BODY: - print_otag(h, TAG_DD, "csw+l", cattr, + print_otag(h, TAG_DD, "csw*+l", cattr, bl->norm->Bl.width); break; default: @@ -746,7 +746,7 @@ mdoc_it_pre(MDOC_ARGS) (n->parent->prev == NULL || n->parent->prev->body == NULL || n->parent->prev->body->child != NULL)) { - t = print_otag(h, TAG_DT, "csw+-l", + t = print_otag(h, TAG_DT, "csw*+-l", cattr, bl->norm->Bl.width); print_text(h, "\\ "); print_tagq(h, t); @@ -754,7 +754,7 @@ mdoc_it_pre(MDOC_ARGS) print_text(h, "\\ "); print_tagq(h, t); } - print_otag(h, TAG_DT, "csw+-l", cattr, + print_otag(h, TAG_DT, "csw*+-l", cattr, bl->norm->Bl.width); break; case ROFFT_BODY: @@ -860,7 +860,7 @@ mdoc_bl_pre(MDOC_ARGS) case LIST_tag: if (bl->offs) print_otag(h, TAG_DIV, "cswl", "Bl-tag", bl->offs); - print_otag(h, TAG_DL, "csw+l", bl->comp ? + print_otag(h, TAG_DL, "csw*+l", bl->comp ? "Bl-tag Bl-compact" : "Bl-tag", bl->width); return 1; case LIST_column: Index: mandoc_html.3 =================================================================== RCS file: /home/cvs/mandoc/mandoc/mandoc_html.3,v retrieving revision 1.9 retrieving revision 1.10 diff -Lmandoc_html.3 -Lmandoc_html.3 -u -p -r1.9 -r1.10 --- mandoc_html.3 +++ mandoc_html.3 @@ -231,12 +231,15 @@ nothing is printed for this pair. .Pp The .Cm w -argument type letter can optionally be followed by one or two +argument type letter can optionally be followed by one, two, or three modifier letters. The modifier +.Cm * +suppresses printing of the pair if the argument matches 6n. +The modifier .Cm + -increases the width by 10% to make even bold text fit -and adds two units for padding between columns. +increases the width by 20% to make even bold text fit +and adds three units for padding between columns. The modifier .Cm \- makes the width negative by multiplying it with \-1. -- To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv