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 e07096ea for ; Thu, 5 Sep 2019 09:59:30 -0500 (EST) Received: from asta-nat.asta.uni-karlsruhe.de ([172.22.63.82] 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 1i5tEO-0006ou-1m; Thu, 05 Sep 2019 16:59:29 +0200 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.77) (envelope-from ) id 1i5tEM-0000Ut-Nw; Thu, 05 Sep 2019 16:59:26 +0200 Received: from athene.usta.de ([172.24.96.10]) by donnerwolke.usta.de with esmtp (Exim 4.84_2) (envelope-from ) id 1i5tEL-00030a-AA; Thu, 05 Sep 2019 16:59:25 +0200 Received: from localhost (athene.usta.de [local]) by athene.usta.de (OpenSMTPD) with ESMTPA id 05abdadd; Thu, 5 Sep 2019 16:59:26 +0200 (CEST) Date: Thu, 5 Sep 2019 16:59:26 +0200 From: Ingo Schwarze To: "Anthony J. Bentley" Cc: tech@mandoc.bsd.lv Subject: Re: Implicit Pp in HTML mode Message-ID: <20190905145926.GB69022@athene.usta.de> References: <52570.1560410767@desktop.ajb.soy> X-Mailinglist: mandoc-tech Reply-To: tech@mandoc.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52570.1560410767@desktop.ajb.soy> User-Agent: Mutt/1.8.0 (2017-02-23) Hi Anthony, Anthony J. Bentley wrote on Thu, Jun 13, 2019 at 01:26:07AM -0600: > It's common in mdoc(7) to leave out a Pp immediately after Sh: > > .Sh DESCRIPTION > For each operand that names a > > When mandoc(1) converts this to HTML, it doesn't add a

tag in front. > Although this is not a validation error, it does mean the resulting DOM > is not what's expected. > > If you add "p { color: red; }" to the stylesheet, it's immediately clear > that the first paragraph of a section is not and cannot be styled like > the rest, because there's nothing telling the browser that it's a > paragraph in the first place. Because it is semantically a paragraph, > it should be wrapped in

in HTML output. I believe this issue is now fixed in CVS HEAD. The CVS HEAD version is also running on man.openbsd.org. So testing is now welcome. Getting it done took a bit longer because even though the crucial commit touched only a few lines in in html.c, it required several preparations in various places and figuring out how to put all the pieces together was rather tricky, as it usually is when translating between languages using significantly different paradigms - and yes, how mdoc(7), man(7), and HTML think about paragraphs is very different. Note that the current solution goes a bit further than Anthony suggested. It doesn't merely add

before text at the beginning of sections, but also before phrasing elements at this point, and also before text and phrasing elements after top-level flow content - for example, after top-level .El. All the same, it may still not be perfect. For example, if there is multi-paragraph text in the body of a list item, the first paragraph still won't get a

. Clearly, putting

inside every

  • and
    would be excessive because many list item bodies only contain single words, not whole paragraphs. Maybe a

    should be inserted at the beginning of non-compact list item bodies that contain at least one explicit .Pp, or something similar. But i didn't do that yet such that we can first watch the dust settle, then maybe advance another step. There may be more cases where additional automatic

    elements might make sense inside specific flow containers. Please tell me if you encounter such cases that matter in practice. Yours, Ingo -- To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv