diff options
author | schwarze <schwarze@openbsd.org> | 2021-03-30 19:23:50 +0000 |
---|---|---|
committer | schwarze <schwarze@openbsd.org> | 2021-03-30 19:23:50 +0000 |
commit | 4529325a8a141549d437f69180f87d8e684a0235 (patch) | |
tree | 3bead5f38f5cc923591e1853a220d93797e3a165 /usr.bin | |
parent | Handle systems, such as the Dell Precision 3640, that access (diff) | |
download | wireguard-openbsd-4529325a8a141549d437f69180f87d8e684a0235.tar.xz wireguard-openbsd-4529325a8a141549d437f69180f87d8e684a0235.zip |
In HTML output, correctly render .Bd -unfilled in proportionally-spaced
font, rather than with the monospace font appropriate for .Bd -literal.
This fixes a minibug reported by anton@.
Implemented by no longer relying on the typical browser default of
"pre { font-family: monospace }" but instead letting <pre> elements
inherit the font family from their parent, then adding an explicit CSS .Li
class only for those displays where the manual page author requested it
by using the -literal option on the .Bd macro.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/mandoc/mandoc.css | 3 | ||||
-rw-r--r-- | usr.bin/mandoc/mdoc_html.c | 9 |
2 files changed, 8 insertions, 4 deletions
diff --git a/usr.bin/mandoc/mandoc.css b/usr.bin/mandoc/mandoc.css index ca7f2602e58..2b19ba68596 100644 --- a/usr.bin/mandoc/mandoc.css +++ b/usr.bin/mandoc/mandoc.css @@ -1,4 +1,4 @@ -/* $OpenBSD: mandoc.css,v 1.34 2020/10/30 21:31:19 schwarze Exp $ */ +/* $OpenBSD: mandoc.css,v 1.35 2021/03/30 19:23:50 schwarze Exp $ */ /* * Standard style sheet for mandoc(1) -Thtml and man.cgi(8). * @@ -31,6 +31,7 @@ td { vertical-align: top; ul, ol, dl { margin-top: 0em; margin-bottom: 0em; } li, dt { margin-top: 1em; } +pre { font-family: inherit; } .permalink { border-bottom: thin dotted; color: inherit; diff --git a/usr.bin/mandoc/mdoc_html.c b/usr.bin/mandoc/mdoc_html.c index b5442dfd9b4..e6dbfbe4a83 100644 --- a/usr.bin/mandoc/mdoc_html.c +++ b/usr.bin/mandoc/mdoc_html.c @@ -1,6 +1,6 @@ -/* $OpenBSD: mdoc_html.c,v 1.216 2020/10/16 17:22:39 schwarze Exp $ */ +/* $OpenBSD: mdoc_html.c,v 1.217 2021/03/30 19:23:50 schwarze Exp $ */ /* - * Copyright (c) 2014-2020 Ingo Schwarze <schwarze@openbsd.org> + * Copyright (c) 2014-2021 Ingo Schwarze <schwarze@openbsd.org> * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * * Permission to use, copy, modify, and distribute this software for any @@ -928,7 +928,7 @@ mdoc_sx_pre(MDOC_ARGS) static int mdoc_bd_pre(MDOC_ARGS) { - char buf[16]; + char buf[20]; struct roff_node *nn; int comp; @@ -965,6 +965,9 @@ mdoc_bd_pre(MDOC_ARGS) strcmp(n->norm->Bd.offs, "left") != 0) (void)strlcat(buf, " Bd-indent", sizeof(buf)); + if (n->norm->Bd.type == DISP_literal) + (void)strlcat(buf, " Li", sizeof(buf)); + print_otag_id(h, TAG_DIV, buf, n); return 1; } |