Ha, got it! On Tue, Oct 12, 2021 at 09:42:30PM +0200, наб wrote: > This one's weird, since I've written dozens of this sort of table before > and it's always worked, but this is somehow broken. A minimal example is > -- >8 -- > .Sh NAME > .Nm a > . > .Sh EXAMPLES > .Bd -literal > .Nm > b > .Ed > -- >8 -- If you apply this: -- >8 -- Index: mdoc_html.c =================================================================== RCS file: /cvs/mandoc/mdoc_html.c,v retrieving revision 1.342 diff -u -r1.342 mdoc_html.c --- mdoc_html.c 30 Mar 2021 19:26:20 -0000 1.342 +++ mdoc_html.c 15 Oct 2021 22:58:35 -0000 @@ -335,6 +335,8 @@ { while (n != NULL) { +if(!strcmp(n->string ?: "", "a")) + fprintf(stderr, "a: %d\n", n->flags); print_mdoc_node(meta, n, h); n = n->next; } -- >8 -- Then the original test file gives this: -- >8 -- nabijaczleweli@babtop:/tmp/mandoc$ stdbuf -o0 ./mandoc -Thtml -Ofragment /tmp/a.1 -mdoc
UNTITLED LOCAL UNTITLED

a: 3 a

a: 515
a b
-- >8 -- But one with an explicit ".Nm a" instead, which yields correct output, gives this: -- >8 -- nabijaczleweli@babtop:/tmp/mandoc$ stdbuf -o0 ./mandoc -Thtml -Ofragment /tmp/a2.1 -mdoc
UNTITLED LOCAL UNTITLED

a: 3 a

a: 259
a
b
-- >8 -- A glance at the flags gives us 259 = 0b0100000011 = NODE_NOFILL|NODE_VALID|NODE_ENDED 515 = 0b1000000011 = NODE_NOSRC |NODE_VALID|NODE_ENDED This explodes in print_mdoc_node(), which does -- >8 -- static void print_mdoc_node(MDOC_ARGS) { if (n->type == ROFFT_COMMENT || n->flags & NODE_NOPRT) return; if ((n->flags & NODE_NOFILL) == 0) html_fillmode(h, ROFF_fi); else if (html_fillmode(h, ROFF_nf) == ROFF_nf && n->tok != ROFF_fi && n->flags & NODE_LINE) print_endline(h); ... -- >8 -- Explicit Nm takes the latter branch, implicit the former, and setting fillmode to fi outputs the dreaded "". Needless to say, the fix is to set NODE_NOFILL on implicit Nms, like it's done on explicit Nms: -- >8 -- nabijaczleweli@babtop:/tmp/mandoc$ stdbuf -o0 ./mandoc -Thtml -Ofragment /tmp/a.1 -mdoc
UNTITLED LOCAL UNTITLED

a: 3 a

a: 771
a
b
-- >8 -- Where 771 = 0b1100000011 = NODE_NOSRC|NODE_NOFILL|NODE_VALID|NODE_ENDED Since ISTR you being somehow morally opposed to taking my patches, my friendly advice is that I've found the code that sets this flag to be at the tail-end of post_nm(), instead. Best, наб