diff options
-rw-r--r-- | usr.bin/mandoc/html.c | 16 | ||||
-rw-r--r-- | usr.bin/mandoc/mdoc_html.c | 10 |
2 files changed, 16 insertions, 10 deletions
diff --git a/usr.bin/mandoc/html.c b/usr.bin/mandoc/html.c index 323888d3520..1f4286f66d4 100644 --- a/usr.bin/mandoc/html.c +++ b/usr.bin/mandoc/html.c @@ -1,4 +1,4 @@ -/* $OpenBSD: html.c,v 1.80 2017/03/15 11:29:50 schwarze Exp $ */ +/* $OpenBSD: html.c,v 1.81 2017/05/12 17:56:39 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011-2015, 2017 Ingo Schwarze <schwarze@openbsd.org> @@ -607,15 +607,21 @@ print_otag(struct html *h, enum htmltag tag, const char *fmt, ...) SCALE_VS_INIT(su, i); break; case 'w': - case 'W': if ((arg2 = va_arg(ap, char *)) == NULL) break; su = &mysu; a2width(arg2, su); - /* Increase width to make even bold text fit. */ - su->scale *= 1.1; - if (fmt[-1] == 'W') + if (*fmt == '+') { + /* Increase to make even bold text fit. */ + su->scale *= 1.15; + /* Add padding. */ + su->scale += 3.0; + fmt++; + } + if (*fmt == '-') { su->scale *= -1.0; + fmt++; + } break; default: abort(); diff --git a/usr.bin/mandoc/mdoc_html.c b/usr.bin/mandoc/mdoc_html.c index 5efe1666c1c..cd0f10c26a7 100644 --- a/usr.bin/mandoc/mdoc_html.c +++ b/usr.bin/mandoc/mdoc_html.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mdoc_html.c,v 1.161 2017/05/09 14:09:37 schwarze Exp $ */ +/* $OpenBSD: mdoc_html.c,v 1.162 2017/05/12 17:56:39 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze <schwarze@openbsd.org> @@ -766,7 +766,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, "csWl", + t = print_otag(h, TAG_DT, "csw+-l", cattr, bl->norm->Bl.width); print_text(h, "\\ "); print_tagq(h, t); @@ -774,7 +774,7 @@ mdoc_it_pre(MDOC_ARGS) print_text(h, "\\ "); print_tagq(h, t); } - print_otag(h, TAG_DT, "csWl", cattr, + print_otag(h, TAG_DT, "csw+-l", cattr, bl->norm->Bl.width); break; case ROFFT_BODY: @@ -837,7 +837,7 @@ mdoc_bl_pre(MDOC_ARGS) t = print_otag(h, TAG_COLGROUP, ""); for (i = 0; i < bl->ncols - 1; i++) - print_otag(h, TAG_COL, "sww", bl->cols[i]); + print_otag(h, TAG_COL, "sw+w", bl->cols[i]); print_otag(h, TAG_COL, "swW", bl->cols[i]); print_tagq(h, t); return 0; @@ -884,7 +884,7 @@ mdoc_bl_pre(MDOC_ARGS) cattr = "Bl-tag"; if (bl->offs) print_otag(h, TAG_DIV, "cswl", cattr, bl->offs); - print_otag(h, TAG_DL, "cswl", cattr, bl->width); + print_otag(h, TAG_DL, "csw+l", cattr, bl->width); return 1; case LIST_column: elemtype = TAG_TABLE; |