summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2017-07-15 17:57:47 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2017-07-15 17:57:47 +0000
commit42f2980f197eac5f30366d4f3d13e58e56075cfd (patch)
treeb972918fa43fe630d3f02296d5c17fffb3f95c61 /usr.bin/mandoc/html.c
parentcf1ab7594e2560c6f26f6441c0f4e132b5f726f6 (diff)
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.
Diffstat (limited to 'usr.bin/mandoc/html.c')
-rw-r--r--usr.bin/mandoc/html.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/usr.bin/mandoc/html.c b/usr.bin/mandoc/html.c
index 61f0470e49c..71adc926a9b 100644
--- a/usr.bin/mandoc/html.c
+++ b/usr.bin/mandoc/html.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: html.c,v 1.88 2017/07/14 16:28:35 schwarze Exp $ */
+/* $OpenBSD: html.c,v 1.89 2017/07/15 17:57:46 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -622,24 +622,28 @@ print_otag(struct html *h, enum htmltag tag, const char *fmt, ...)
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;