From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 21654 invoked from network); 30 Mar 2021 19:26:26 -0000 Received: from bsd.lv (HELO mandoc.bsd.lv) (66.111.2.12) by inbox.vuxu.org with ESMTPUTF8; 30 Mar 2021 19:26:26 -0000 Received: from fantadrom.bsd.lv (localhost [127.0.0.1]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id 43b4c408 for ; Tue, 30 Mar 2021 14:26:23 -0500 (EST) Received: from localhost (mandoc.bsd.lv [local]) by mandoc.bsd.lv (OpenSMTPD) with ESMTPA id 9d4ade64 for ; Tue, 30 Mar 2021 14:26:23 -0500 (EST) Date: Tue, 30 Mar 2021 14:26:23 -0500 (EST) X-Mailinglist: mandoc-source Reply-To: source@mandoc.bsd.lv MIME-Version: 1.0 From: schwarze@mandoc.bsd.lv To: source@mandoc.bsd.lv Subject: mandoc: In HTML output, correctly render .Bd -unfilled in X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Message-ID: Log Message: ----------- 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
 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.

Modified Files:
--------------
    mandoc:
        mandoc.css
        mdoc_html.c
    mandoc/regress/mdoc/Bd:
        paragraph.out_html

Revision Data
-------------
Index: mandoc.css
===================================================================
RCS file: /home/cvs/mandoc/mandoc/mandoc.css,v
retrieving revision 1.47
retrieving revision 1.48
diff -Lmandoc.css -Lmandoc.css -u -p -r1.47 -r1.48
--- mandoc.css
+++ mandoc.css
@@ -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;
Index: mdoc_html.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/mdoc_html.c,v
retrieving revision 1.341
retrieving revision 1.342
diff -Lmdoc_html.c -Lmdoc_html.c -u -p -r1.341 -r1.342
--- mdoc_html.c
+++ mdoc_html.c
@@ -1,6 +1,6 @@
 /* $Id$ */
 /*
- * Copyright (c) 2014-2020 Ingo Schwarze 
+ * Copyright (c) 2014-2021 Ingo Schwarze 
  * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons 
  *
  * 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;
 
@@ -966,6 +966,9 @@ mdoc_bd_pre(MDOC_ARGS)
 	if (n->norm->Bd.offs != NULL &&
 	    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;
Index: paragraph.out_html
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/mdoc/Bd/paragraph.out_html,v
retrieving revision 1.6
retrieving revision 1.7
diff -Lregress/mdoc/Bd/paragraph.out_html -Lregress/mdoc/Bd/paragraph.out_html -u -p -r1.6 -r1.7
--- regress/mdoc/Bd/paragraph.out_html
+++ regress/mdoc/Bd/paragraph.out_html
@@ -7,7 +7,7 @@
 
 back to normal
 

another paragraph

-
+
 literal
 display
 
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv