help / color / mirror / Atom feed
From: Ingo Schwarze <>
To: "Anthony J. Bentley" <>
Subject: Re: Implicit Pp in HTML mode
Date: Thu, 5 Sep 2019 16:59:26 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

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:
> For each operand that names a
> When mandoc(1) converts this to HTML, it doesn't add a <p> 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 <p> in HTML output.

I believe this issue is now fixed in CVS HEAD.
The CVS HEAD version is also running on
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 <p> 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 <p>.  Clearly, putting <p> inside every
<li> and <dd> would be excessive because many list item bodies only
contain single words, not whole paragraphs.  Maybe a <p> 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 <p> elements
might make sense inside specific flow containers.

Please tell me if you encounter such cases that matter in practice.

 To unsubscribe send an email to

      reply	other threads:[~2019-09-05 14:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-13  7:26 Anthony J. Bentley
2019-09-05 14:59 ` Ingo Schwarze [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \
    --subject='Re: Implicit Pp in HTML mode' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).