diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2022-08-02 11:55:52 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2022-08-02 11:55:52 +0000 |
commit | f8366bb905de7a6e5174bfe6813d2635d3b7469a (patch) | |
tree | a8a4db9439891d4dbc09beebf5a561e50a799c88 /usr.bin/mandoc | |
parent | 4744f78fbcd877d7e89b0a2a599ffb6d0efe68d1 (diff) |
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 <a> 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 <alx dot manpages at gmail dot com>.
Diffstat (limited to 'usr.bin/mandoc')
-rw-r--r-- | usr.bin/mandoc/man_validate.c | 4 | ||||
-rw-r--r-- | usr.bin/mandoc/mandoc.1 | 8 |
2 files changed, 4 insertions, 8 deletions
diff --git a/usr.bin/mandoc/man_validate.c b/usr.bin/mandoc/man_validate.c index 32cb55a301f..56c3f46c400 100644 --- a/usr.bin/mandoc/man_validate.c +++ b/usr.bin/mandoc/man_validate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: man_validate.c,v 1.126 2021/08/10 12:36:42 schwarze Exp $ */ +/* $OpenBSD: man_validate.c,v 1.127 2022/08/02 11:55:51 schwarze Exp $ */ /* * Copyright (c) 2010, 2012-2020 Ingo Schwarze <schwarze@openbsd.org> * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> @@ -371,13 +371,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]); diff --git a/usr.bin/mandoc/mandoc.1 b/usr.bin/mandoc/mandoc.1 index 1880c30636c..931370665f6 100644 --- a/usr.bin/mandoc/mandoc.1 +++ b/usr.bin/mandoc/mandoc.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: mandoc.1,v 1.188 2022/06/28 04:36:29 jsg Exp $ +.\" $OpenBSD: mandoc.1,v 1.189 2022/08/02 11:55:51 schwarze Exp $ .\" .\" Copyright (c) 2012, 2014-2022 Ingo Schwarze <schwarze@openbsd.org> .\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: June 28 2022 $ +.Dd $Mdocdate: August 2 2022 $ .Dt MANDOC 1 .Os .Sh NAME @@ -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 |