=================================================================== RCS file: /cvs/mandoc/mdoc_macro.c,v retrieving revision 1.114 retrieving revision 1.117 diff -u -p -r1.114 -r1.117 --- mandoc/mdoc_macro.c 2012/01/02 15:48:05 1.114 +++ mandoc/mdoc_macro.c 2012/07/18 16:20:43 1.117 @@ -1,7 +1,7 @@ -/* $Id: mdoc_macro.c,v 1.114 2012/01/02 15:48:05 kristaps Exp $ */ +/* $Id: mdoc_macro.c,v 1.117 2012/07/18 16:20:43 schwarze Exp $ */ /* - * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons - * Copyright (c) 2010 Ingo Schwarze + * Copyright (c) 2008-2012 Kristaps Dzonsons + * Copyright (c) 2010, 2012 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -994,16 +994,6 @@ blk_full(MACRO_PROT_ARGS) enum margverr av; char *p; - /* - * Exception: `-diag' lists are not parsed, but lists in general - * are parsed. - */ - nparsed = 0; - if (MDOC_It == tok && NULL != m->last && - MDOC_Bl == m->last->tok && - LIST_diag == m->last->norm->Bl.type) - nparsed = 1; - nl = MDOC_NEWLINE & m->flags; /* Close out prior implicit scope. */ @@ -1048,6 +1038,14 @@ blk_full(MACRO_PROT_ARGS) head = body = NULL; /* + * Exception: Heads of `It' macros in `-diag' lists are not + * parsed, even though `It' macros in general are parsed. + */ + nparsed = MDOC_It == tok && + MDOC_Bl == m->last->parent->tok && + LIST_diag == m->last->parent->norm->Bl.type; + + /* * The `Nd' macro has all arguments in its body: it's a hybrid * of block partial-explicit and full-implicit. Stupid. */ @@ -1360,6 +1358,13 @@ blk_part_imp(MACRO_PROT_ARGS) if (n && ! rew_sub(MDOC_BLOCK, m, tok, line, ppos)) return(0); + + /* Move trailing .Ns out of scope. */ + + for (n = body->child; n && n->next; n = n->next) + /* Do nothing. */ ; + if (n && MDOC_Ns == n->tok) + mdoc_node_relink(m, n); return(1); }