summaryrefslogtreecommitdiffstats
path: root/mdoc_validate.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-02-03 00:48:47 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-02-03 00:48:47 +0000
commit2efed192ca84723eb58ba173fb232892e4af0a3a (patch)
treef12424b7099ebfb6a337c56b70868f97fefef6a2 /mdoc_validate.c
parent722eb681eacb445abee48a93e7201b627c5f4122 (diff)
downloadmandoc-2efed192ca84723eb58ba173fb232892e4af0a3a.tar.gz
Bring .Pp/.Lp handling inside .Nm blocks closer to groff;
as a bonus, get rid of another call to rew_sub().
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r--mdoc_validate.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c
index aece0c72..71a01529 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -1,7 +1,7 @@
/* $Id$ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2010 Joerg Sonnenberger <joerg@netbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
@@ -1047,15 +1047,23 @@ post_vt(POST_ARGS)
static void
post_nm(POST_ARGS)
{
+ struct mdoc_node *n;
+
+ n = mdoc->last;
+
+ if (n->last != NULL &&
+ (n->last->tok == MDOC_Pp ||
+ n->last->tok == MDOC_Lp))
+ mdoc_node_relink(mdoc, n->last);
if (NULL != mdoc->meta.name)
return;
- mdoc_deroff(&mdoc->meta.name, mdoc->last);
+ mdoc_deroff(&mdoc->meta.name, n);
if (NULL == mdoc->meta.name)
mandoc_msg(MANDOCERR_NM_NONAME, mdoc->parse,
- mdoc->last->line, mdoc->last->pos, "Nm");
+ n->line, n->pos, "Nm");
}
static void