summaryrefslogtreecommitdiffstats
path: root/mdoc_html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2021-03-30 19:26:20 +0000
committerIngo Schwarze <schwarze@openbsd.org>2021-03-30 19:26:20 +0000
commit184eafa56a9bef7700f0cef2dbcaffc507d775a0 (patch)
tree332419a6f594c330550d7e1c30802a77f4ca7629 /mdoc_html.c
parent0ae41972c4e3731fd95da0071fd4ea8501373d4f (diff)
downloadmandoc-184eafa56a9bef7700f0cef2dbcaffc507d775a0.tar.gz
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 'mdoc_html.c')
-rw-r--r--mdoc_html.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/mdoc_html.c b/mdoc_html.c
index f698bc27..2dde0531 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -1,6 +1,6 @@
/* $Id$ */
/*
- * 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
@@ -930,7 +930,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;
@@ -967,6 +967,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;
}