diff options
| author | Ingo Schwarze <schwarze@openbsd.org> | 2017-07-15 17:57:51 +0000 |
|---|---|---|
| committer | Ingo Schwarze <schwarze@openbsd.org> | 2017-07-15 17:57:51 +0000 |
| commit | 0c1b7bd0c0c67e2ee5fee8952d8aa5f5ef33ee28 (patch) | |
| tree | 2d639b4be90bc59683fc42694291eec72aa97e2c /html.c | |
| parent | e44a947b4a0b91d4b188ffc1061e6609475bf493 (diff) | |
| download | mandoc-0c1b7bd0c0c67e2ee5fee8952d8aa5f5ef33ee28.tar.gz mandoc-0c1b7bd0c0c67e2ee5fee8952d8aa5f5ef33ee28.zip | |
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 'html.c')
| -rw-r--r-- | html.c | 32 |
1 files changed, 18 insertions, 14 deletions
@@ -1,4 +1,4 @@ -/* $Id: html.c,v 1.218 2017/07/14 16:28:38 schwarze Exp $ */ +/* $Id: html.c,v 1.219 2017/07/15 17:57:51 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011-2015, 2017 Ingo Schwarze <schwarze@openbsd.org> @@ -624,24 +624,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; |
