From 2efed192ca84723eb58ba173fb232892e4af0a3a Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Tue, 3 Feb 2015 00:48:47 +0000 Subject: Bring .Pp/.Lp handling inside .Nm blocks closer to groff; as a bonus, get rid of another call to rew_sub(). --- mdoc_validate.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'mdoc_validate.c') 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 - * Copyright (c) 2010-2014 Ingo Schwarze + * Copyright (c) 2010-2015 Ingo Schwarze * Copyright (c) 2010 Joerg Sonnenberger * * 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 -- cgit