From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from scc-mailout-kit-01.scc.kit.edu (scc-mailout-kit-01.scc.kit.edu [129.13.231.81]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id faafc5b8 for ; Wed, 12 Feb 2020 10:06:58 -0500 (EST) Received: from hekate.asta.kit.edu ([141.3.145.153] helo=hekate.usta.de) by scc-mailout-kit-01.scc.kit.edu with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (envelope-from ) id 1j1tbC-0002QD-0u; Wed, 12 Feb 2020 16:06:57 +0100 Received: from donnerwolke.asta.kit.edu ([141.3.145.61] helo=donnerwolke.usta.de) by hekate.usta.de with esmtp (Exim 4.92.2) (envelope-from ) id 1j1tb8-0005yX-Sv; Wed, 12 Feb 2020 16:06:42 +0100 Received: from athene.asta.kit.edu ([141.3.145.60] helo=athene.usta.de) by donnerwolke.usta.de with esmtp (Exim 4.84_2) (envelope-from ) id 1j1tb8-0007u4-O8; Wed, 12 Feb 2020 16:06:42 +0100 Received: from localhost (athene.usta.de [local]) by athene.usta.de (OpenSMTPD) with ESMTPA id 108cb534; Wed, 12 Feb 2020 16:06:42 +0100 (CET) Date: Wed, 12 Feb 2020 16:06:42 +0100 From: Ingo Schwarze To: Jan Stary , "Jason A. Donenfeld" Cc: discuss@mandoc.bsd.lv Subject: Re: discrepancy between groff and mandoc for html rendering of wg-quick(8) Message-ID: <20200212150642.GB20240@athene.usta.de> References: <20200212070229.GA90820@www.stare.cz> X-Mailinglist: mandoc-discuss Reply-To: discuss@mandoc.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200212070229.GA90820@www.stare.cz> User-Agent: Mutt/1.12.2 (2019-09-21) Hi Jan, hi Jason, Jan Stary wrote on Wed, Feb 12, 2020 at 08:02:29AM +0100: > On Feb 11 23:59:21, Jason@zx2c4.com wrote: >> [mandoc] https://manpages.debian.org/testing/wireguard-tools/wg-quick.8.en.html > That is not the output of mandoc -Thmtl as such. > That's mandoc's html output inset into a debian webpage. While that is true, it is not really relevant. The OP did find a bug in mandoc, which you can see by comparing the output from the following two commands, even with mandoc -current: $ printf "A\n.br\nB\n" | mandoc -T html $ printf "A\n.br\n B\n" | mandoc -T html In the second case, the
element is missing between the "A" and the "B", even though in terminal output mode (i.e. without the -T html), the line break is correctly emitted in both cases. A first superficial inspection reveals that the validation module is probably making invalid assumptions that leading whitespace on an input line automatically implies a line break for all output modes, which is not true for HTML. I'll need to have a closer look how to fix this; i'm not yet sure whether the validator or the formatter or both need to be changed. >> [groff] https://git.zx2c4.com/wireguard-tools/about/src/man/wg-quick.8 > That is not the output of gorff -Thmtl -mman either. > That's groff's html output inset into a webpage. Again, not really relevant. It does show that groff respects the .br request, which, of course, is not surprising at all. >> Look at the "EXAMPLES" section. Notice weird line break issues with mandoc. >> Is this a man page source bug or a mandoc bug? >> Source is here: https://git.zx2c4.com/wireguard-tools/tree/src/man/wg-quick.8 > Take that source, produce the two html outputs > > mandoc -Thtml wg-quick.8 > wg.mandoc.html > groff -Thtml -mman wg-quick.8 > wg.groff.html > > and compare the results. They are different, > but none has the line breaks in EXAMPLES. According to my testing, "groff -Thtml -mman wg-quick.8" does produce the expected line breaks, e.g.: [...]

EXAMPLES [...]

[Peer]
PublicKey = GtL7fZc/bLnqZldpVofMCD6hDjrK28SsdLxevJ+qtKU=
PresharedKey = /UwcSPg38hW/D9Y3tcS1FOV0K1wuURMbS0sesJEP5ak=
AllowedIPs = 0.0.0.0/0
Endpoint = demo.wireguard.com:51820

I think we are talking about the
lines before and after "PresharedKey", for example. So the bug report is clearly valid and also precise enough to help me fix it. Thanks for the report, Ingo -- To unsubscribe send an email to discuss+unsubscribe@mandoc.bsd.lv