* mandoc: In .Bl -tag and -hang, do not print a margin-left style
@ 2017-07-15 17:58 schwarze
0 siblings, 0 replies; only message in thread
From: schwarze @ 2017-07-15 17:58 UTC (permalink / raw)
To: source
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 <steffen at sdaoden dot eu>
on <groff at GNU dot org> 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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-07-15 17:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-15 17:58 mandoc: In .Bl -tag and -hang, do not print a margin-left style schwarze
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).