diff options
-rw-r--r-- | mandoc.1 | 5 | ||||
-rw-r--r-- | mandoc.h | 1 | ||||
-rw-r--r-- | mdoc_validate.c | 6 | ||||
-rw-r--r-- | read.c | 1 |
4 files changed, 13 insertions, 0 deletions
@@ -763,6 +763,11 @@ macro that could be represented using .Ic \&Fx , or .Ic \&Dx . +.It Sy "description line ends with a full stop" +.Pq mdoc +Do not use punctuation at the end of an +.Ic \&Nd +block. .El .Ss Warnings related to the document prologue .Bl -ohang @@ -48,6 +48,7 @@ enum mandocerr { MANDOCERR_MACRO_USELESS, /* useless macro: macro */ MANDOCERR_BX, /* consider using OS macro: macro */ + MANDOCERR_ND_DOT, /* description line ends with a full stop */ MANDOCERR_WARNING, /* ===== start of warnings ===== */ diff --git a/mdoc_validate.c b/mdoc_validate.c index 1a9dce2b..98e6a77d 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -1076,6 +1076,7 @@ static void post_nd(POST_ARGS) { struct roff_node *n; + size_t sz; n = mdoc->last; @@ -1089,6 +1090,11 @@ post_nd(POST_ARGS) if (n->child == NULL) mandoc_msg(MANDOCERR_ND_EMPTY, mdoc->parse, n->line, n->pos, "Nd"); + else if (n->last->type == ROFFT_TEXT && + (sz = strlen(n->last->string)) != 0 && + n->last->string[sz - 1] == '.') + mandoc_msg(MANDOCERR_ND_DOT, mdoc->parse, + n->last->line, n->last->pos + sz - 1, NULL); post_hyph(mdoc); } @@ -90,6 +90,7 @@ static const char * const mandocerrs[MANDOCERR_MAX] = { "useless macro", "consider using OS macro", + "description line ends with a full stop", "generic warning", |