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=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 28081 invoked from network); 2 Aug 2022 12:03:04 -0000 Received: from bsd.lv (HELO mandoc.bsd.lv) (66.111.2.12) by inbox.vuxu.org with ESMTPUTF8; 2 Aug 2022 12:03:04 -0000 Received: from fantadrom.bsd.lv (localhost [127.0.0.1]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id 588432c1 for ; Tue, 2 Aug 2022 07:03:02 -0500 (EST) Received: from localhost (mandoc.bsd.lv [local]) by mandoc.bsd.lv (OpenSMTPD) with ESMTPA id 81a1a0d7 for ; Tue, 2 Aug 2022 07:03:02 -0500 (EST) Date: Tue, 2 Aug 2022 07:03:02 -0500 (EST) X-Mailinglist: mandoc-source Reply-To: source@mandoc.bsd.lv MIME-Version: 1.0 From: schwarze@mandoc.bsd.lv To: source@mandoc.bsd.lv Subject: mandoc: If the body of a man(7) .MT or .UR block is empty, do not emit a X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Message-ID: <3368ec4f26a3ab33@mandoc.bsd.lv> Log Message: ----------- If the body of a man(7) .MT or .UR block is empty, do not emit a warning. Leaving the body empty is legitimate in this case if the author only wants to display a mail address or URI without providing a link text. Output modules already handle this correctly: terminal output shows just the URI without an accompanying text, HTML output uses the URI for *both* the href= attribute and as the content of the element. The documentation was also wrong and claimed that an .MT or .UR block with an empty body would produce no output. As explained above, this isn't true. Bogus warning reported by Alejandro Colomar . Modified Files: -------------- mandoc: man_validate.c mandoc.1 mandoc/regress/man/MT: args.out_lint mandoc/regress/man/UR: args.out_lint Revision Data ------------- Index: args.out_lint =================================================================== RCS file: /home/cvs/mandoc/mandoc/regress/man/MT/args.out_lint,v retrieving revision 1.3 retrieving revision 1.4 diff -Lregress/man/MT/args.out_lint -Lregress/man/MT/args.out_lint -u -p -r1.3 -r1.4 --- regress/man/MT/args.out_lint +++ regress/man/MT/args.out_lint @@ -1,5 +1,3 @@ mandoc: args.in:28:11: ERROR: skipping excess arguments: MT ... second mandoc: args.in:33:11: ERROR: skipping excess arguments: MT ... second -mandoc: args.in:19:2: WARNING: empty block: MT mandoc: args.in:23:2: WARNING: missing resource identifier, using "": MT -mandoc: args.in:33:2: WARNING: empty block: MT Index: mandoc.1 =================================================================== RCS file: /home/cvs/mandoc/mandoc/mandoc.1,v retrieving revision 1.262 retrieving revision 1.263 diff -Lmandoc.1 -Lmandoc.1 -u -p -r1.262 -r1.263 --- mandoc.1 +++ mandoc.1 @@ -1473,10 +1473,8 @@ A .Ic \&Bl , .Ic \&D1 , .Ic \&Dl , -.Ic \&MT , -.Ic \&RS , or -.Ic \&UR +.Ic \&RS block contains nothing in its body and will produce no output. .It Sy "empty argument, using 0n" .Pq mdoc Index: man_validate.c =================================================================== RCS file: /home/cvs/mandoc/mandoc/man_validate.c,v retrieving revision 1.156 retrieving revision 1.157 diff -Lman_validate.c -Lman_validate.c -u -p -r1.156 -r1.157 --- man_validate.c +++ man_validate.c @@ -373,13 +373,11 @@ post_UR(CHKARGS) if (n->type == ROFFT_HEAD && n->child == NULL) mandoc_msg(MANDOCERR_UR_NOHEAD, n->line, n->pos, "%s", roff_name[n->tok]); - check_part(man, n); } static void check_part(CHKARGS) { - if (n->type == ROFFT_BODY && n->child == NULL) mandoc_msg(MANDOCERR_BLK_EMPTY, n->line, n->pos, "%s", roff_name[n->tok]); Index: args.out_lint =================================================================== RCS file: /home/cvs/mandoc/mandoc/regress/man/UR/args.out_lint,v retrieving revision 1.5 retrieving revision 1.6 diff -Lregress/man/UR/args.out_lint -Lregress/man/UR/args.out_lint -u -p -r1.5 -r1.6 --- regress/man/UR/args.out_lint +++ regress/man/UR/args.out_lint @@ -1,5 +1,3 @@ mandoc: args.in:28:11: ERROR: skipping excess arguments: UR ... second mandoc: args.in:33:11: ERROR: skipping excess arguments: UR ... second -mandoc: args.in:19:2: WARNING: empty block: UR mandoc: args.in:23:2: WARNING: missing resource identifier, using "": UR -mandoc: args.in:33:2: WARNING: empty block: UR -- To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv