For empty input, mandoc produce 3 lines output with brackets: $ mandoc < /dev/null | wc -l 3 $ mandoc < /dev/null () () () this looks strange. GNU groff works fine: $ nroff -mandoc < /dev/null | wc -l 0
% mandoc < /dev/null | wc -l 3 % sh $ mandoc < /dev/null | wc -l 3 $ uname -aKU FreeBSD mowa219-gjp4-8570p-freebsd 15.0-CURRENT FreeBSD 15.0-CURRENT #15 main-n265538-915af883221a: Tue Sep 26 14:50:08 BST 2023 grahamperrin@mowa219-gjp4-8570p-freebsd:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64 1500001 1500000 $
Sorry, ignore my comment 1. (In reply to Wolfram Schneider from comment #0) > For empty input, I get the same.
patch sent upstream.
Upstream talking here... Why do you want this? What is so special about empty input compared to other non-manual-page input that you want special handling for one but not for the other? For example, doas it matter for you what echo foo | mandoc does, and if it matters, why does that matter for you? While mandoc(1) usually strives for groff compatibility *inside manual pages*, handling arbitrary low-level roff(7) input *outside manual pages* is not among the goals of mandoc(1). I'm not saying what you are asking for is unreasonable. What i'm trying to say is that i need to understand what you need this for before i can make up my mind whether and how your goals might be reached. Bapt@'s very ad-hoc patch does not strike me as particularly useful as far as i can see so far.