From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: **** X-Spam-Status: No, score=4.7 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, FROM_SUSPICIOUS_NTLD,FROM_SUSPICIOUS_NTLD_FP,PDS_OTHER_BAD_TLD, T_TVD_MIME_EPI autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 10166 invoked from network); 12 Oct 2021 19:42:39 -0000 Received: from bsd.lv (HELO mandoc.bsd.lv) (66.111.2.12) by inbox.vuxu.org with ESMTPUTF8; 12 Oct 2021 19:42:39 -0000 Received: from fantadrom.bsd.lv (localhost [127.0.0.1]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id 02d94044 for ; Tue, 12 Oct 2021 14:42:35 -0500 (EST) Received: from tarta.nabijaczleweli.xyz (139-28-40-42.artus.net.pl [139.28.40.42]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id 82e90f67 for ; Tue, 12 Oct 2021 14:42:34 -0500 (EST) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id EDBEDE92 for ; Tue, 12 Oct 2021 21:42:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202006; t=1634067752; bh=H/P/M0R9//krh7MDwFR5vIVJKAjNnmzEPswbXzbZ4BQ=; h=Date:From:To:Subject:From; b=KwvvXSvIo6e8Its8gA4+W7H7Y01dsxjuW2u7zqzh4Ogqf9Wbsgr2URiQz6XGM01kl g9tn8r7ztfPsRY/BYwTlnB6fGeqpdPiZgmHBGAbJPRgttVjJEN4sLzkYugNqzdNW3I HdgpOu6l0UQZH3UTSPe3/xC8RQDHnLWhfGMU0Gay+V7TapBMp2vXFJ2T8tXCdtM6ao jwyjMR7u5JZQwtoV/wBkgqaekfzHGIklh3GQAZ/7jE6w7E+KMyBMW4xb2bgK33ZpG5 6ql/EpRgtlT6wFSZzdabSOXOZ3in4wYf6Vyknn2m6bvvVegpsXPfJNaEaf5ByUgXfe pB6frkUU0YzHA== Date: Tue, 12 Oct 2021 21:42:30 +0200 From: =?utf-8?B?0L3QsNCx?= To: tech@mandoc.bsd.lv Subject: Bizarre .Nm-breaking-.Bd's-
 in -Thtml behaviour?
Message-ID: <20211012194230.aoxlusoaktmokwuc@tarta.nabijaczleweli.xyz>
X-Mailinglist: mandoc-tech
Reply-To: tech@mandoc.bsd.lv
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
	protocol="application/pgp-signature"; boundary="77dbk53v3bnbi3qu"
Content-Disposition: inline
User-Agent: NeoMutt/20210205


--77dbk53v3bnbi3qu
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi!

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 --
=2ESh NAME
=2ENm a
=2E
=2ESh EXAMPLES
=2EBd -literal
=2ENm
b
=2EEd
-- >8 --

Which yields
-- >8 --
nabijaczleweli@tarta:~/uwu/mandoc$ ./mandoc -mdoc -Thtml -Ofragment ../kl.8
UNTITLED LOCAL UNTITLED

NAME=

a

= EXAMPLES

a b
-- >8 -- Note how a and b are both (a) past Nm and (b) past the
. This has
an additional funny side-effect of inlining the rest of the display
block. Macros still work, but text is laid normally by the browser,
rather than literally.

I don't know what triggers this in this case and not all others,
but an explicit .Nm argument fixes it (but that's, uh, suboptimal).

Happens on mandoc 1.14.5-1 off Debian and 2021-10-12T21:41:37+02:00 off
CVS.

Best,
=D0=BD=D0=B0=D0=B1

--77dbk53v3bnbi3qu
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEfWlHToQCjFzAxEFjvP0LAY0mWPEFAmFl5SQACgkQvP0LAY0m
WPE2pQ/5AZDeX8ut16DiXMT5JRr4hB3tYbTa7b9liUnK6hYe6reUpPg9xPCwjjvS
86sXKhjdicBbH5MeOnezAFWvusKinHh1rs6WBDSFjvQ9bt9Mwd8pNye472mrtGIX
s+l2YSYDkEmEkgjj44kBg7yFCRZs1CSH6+7e9xqs66cTy7wQ9yMNZlxCf/ZdmI7I
X3b88NVZy1N18PTZaNclP0sY8jRAfqNjURu5CBuIOAE6iI3MsCjrUByO8tnRgOR+
eUkBeewOayzAsJvvJZrlQ143dn5/kB4gXUuJDixYShusbFv96KziFGeKXVoVBzEo
cEYwfqUVNcKeJzNgd92K0IH70/ORYlclSr2WBbEg0cMJYX+O6OcSasFov3b4mDKm
JGGEk7vuyfxcNodEza7dki+Tk0rqUMbYf4Kel3lC6e4PZubr5U+78FU+lhlyCrs2
zIe4pACuagdJeBwJ5Ic8hON8SM+xOLqYQ6OWvXoTPmEdJJ2OU53q86HS6prp1PFv
XZJltpk1w0wdTlcKustvE4eeVi5wBK0FDeE4O3jv3NlS430AKKGzho7Scd9qs64L
aQ2Iv/pv4zGGHGfyr9typrmW33sYaKd7feFr6JmBLAMlx4oHVTu224nHVX1Lzroc
pOWkpCuWm26GoxGUxFVifK2pgr6/OPvy8bcBA2cDtb5cGLrhq9Y=
=5sbx
-----END PGP SIGNATURE-----

--77dbk53v3bnbi3qu--
--
 To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv


From mboxrd@z Thu Jan  1 00:00:00 1970
X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org
X-Spam-Level: **
X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED,
	FROM_SUSPICIOUS_NTLD,PDS_OTHER_BAD_TLD,T_TVD_MIME_EPI autolearn=no
	autolearn_force=no version=3.4.4
Received: (qmail 17740 invoked from network); 15 Oct 2021 23:16:18 -0000
Received: from bsd.lv (HELO mandoc.bsd.lv) (66.111.2.12)
  by inbox.vuxu.org with ESMTPUTF8; 15 Oct 2021 23:16:18 -0000
Received: from fantadrom.bsd.lv (localhost [127.0.0.1])
	by mandoc.bsd.lv (OpenSMTPD) with ESMTP id 0f4e917c
	for ;
	Fri, 15 Oct 2021 18:16:16 -0500 (EST)
Received: from tarta.nabijaczleweli.xyz (139-28-40-42.artus.net.pl [139.28.40.42])
	by mandoc.bsd.lv (OpenSMTPD) with ESMTP id 4c64db98
	for ;
	Fri, 15 Oct 2021 18:16:14 -0500 (EST)
Received: from babtop.nabijaczleweli.xyz (aagp110.neoplus.adsl.tpnet.pl [83.4.171.110])
	by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 022D674E
	for ; Sat, 16 Oct 2021 01:16:11 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz;
	s=202006; t=1634339772;
	bh=9j5qjwP0fFL2jQ6/a+szvGSsf79Q5EsuoWrTaUkVsXk=;
	h=Date:From:To:Subject:References:In-Reply-To:From;
	b=h7P0CbG/tvjlfMWfNY6OgLPuIKvM+NNftbrTNNYjdo4DBP35BtZArfF5Cwbfm359s
	 tY0NRx9qzbWJiAQDhyWgzNTYcH1wZd9j+vnldhdJyq+iqhsyMTnGCfXsPsoyTQXCdS
	 UeaOUrsu7J9N1KJfFSYuLaTtNW2W1S1CEpRbRX1jK9SkQWECfeGPNDCgRlkwmhlEsK
	 vR17i4GvI3XrUUw8oCv1L8Ju1eOXEFlAgMGog2Zgd+833Z3jTaVg8h3eL4yiES1Rxb
	 XZp2sftDHoDSzyWunZ80b25E9e7VL8XOeZgs/ax+ejG+NkOzsmZvN8wfMH0+Y8czbA
	 FGGazJp58LSAQ==
Date: Sat, 16 Oct 2021 01:16:10 +0200
From: =?utf-8?B?0L3QsNCx?= 
To: tech@mandoc.bsd.lv
Subject: Bizarre .Nm-breaking-.Bd's-
 in -Thtml behaviour analysis + not
 a patch
Message-ID: <20211015231610.6zluzvlm2sovcurz@babtop.nabijaczleweli.xyz>
References: <20211012194230.aoxlusoaktmokwuc@tarta.nabijaczleweli.xyz>
X-Mailinglist: mandoc-tech
Reply-To: tech@mandoc.bsd.lv
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
	protocol="application/pgp-signature"; boundary="akpowpskkw6j7iea"
Content-Disposition: inline
In-Reply-To: <20211012194230.aoxlusoaktmokwuc@tarta.nabijaczleweli.xyz>
User-Agent: NeoMutt/20210205


--akpowpskkw6j7iea
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Ha, got it!

On Tue, Oct 12, 2021 at 09:42:30PM +0200, =D0=BD=D0=B0=D0=B1 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
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
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 @@
 {
=20
 	while (n !=3D NULL) {
+if(!strcmp(n->string ?: "", "a"))
+	fprintf(stderr, "a: %d\n", n->flags);
 		print_mdoc_node(meta, n, h);
 		n =3D 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

NAME=

a: 3 a

= EXAMPLES

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

NAME=

a: 3 a

= EXAMPLES

a: 259
a
b
-- >8 -- A glance at the flags gives us 259 =3D 0b0100000011 =3D NODE_NOFILL|NODE_VALID|NODE_ENDED 515 =3D 0b1000000011 =3D 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 =3D=3D ROFFT_COMMENT || n->flags & NODE_NOPRT) return; if ((n->flags & NODE_NOFILL) =3D=3D 0) html_fillmode(h, ROFF_fi); else if (html_fillmode(h, ROFF_nf) =3D=3D ROFF_nf && n->tok !=3D 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

NAME=

a: 3 a

= EXAMPLES

a: 771
a
b
-- >8 -- Where 771 =3D 0b1100000011 =3D 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, =D0=BD=D0=B0=D0=B1 --akpowpskkw6j7iea Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEfWlHToQCjFzAxEFjvP0LAY0mWPEFAmFqC7YACgkQvP0LAY0m WPFlOQ/+J+dot+epu2UwHQ/KAm0D+SmsuoLIzj3UNAHBr4kdjHPq9petMzJF6Oij 9VkdGQQ8rrZEiNCwIIh+x82SBvdy/B1r4UX41Dm42xm8OUOqvf05uodSqDonifLy jrCAnXzZ5VBgGX0NIilk4IjHmFIDr4ltTVxBP+mIqli8bLU3G03kkomZoXLjDvmo +cUFIpK4gc7BAIfqgSwOnWczrd8LZD2udFrl9OtI3VSe6xmdsUIeHhW++yWzIqvi hAbpP1Gzfb2E+hz9kzM16NdR+uCQCkkrCcjLRcdOlX7wBF/vproadBOuc4kHcTFI Qm65innk6S63NsaWtC4nf6uzKAVEjkohxEWc8sqgrooPtFbq7pf19ljYqeKRg4mT 3H4QYyFbTxvTBose+uO6mKktGWGgeHwYp5M6aYZ+Yd+2fP25YY9HaGB4ixkQuqtX Fiq6+2385B4TP5G7gDgSMVUYmRQ7zSyQC0OcARHFqrQ/xAqrVkrDMWb1InX2S/Qe XKDbvVZETAp75pI7+YoCg6IsMGbkNZOSX5X1k5xRswFCkWmi++6w+1GgDWcNlytJ cCJIaOUuPNaqcq45Cq6vzq0hUvT0zIiBhQ5cnWCPyEi05HIKj7pHvlhL9ZCfiEnQ B0ZXv+EI2LGGug069kNHZcbo5+3m8xU4cEW/LqwkIW0N5r491Go= =hiuf -----END PGP SIGNATURE----- --akpowpskkw6j7iea-- -- To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv