=================================================================== RCS file: /cvs/mandoc/mdoc_macro.c,v retrieving revision 1.113 retrieving revision 1.115 diff -u -p -r1.113 -r1.115 --- mandoc/mdoc_macro.c 2011/12/03 23:59:14 1.113 +++ mandoc/mdoc_macro.c 2012/01/05 00:43:51 1.115 @@ -1,4 +1,4 @@ -/* $Id: mdoc_macro.c,v 1.113 2011/12/03 23:59:14 schwarze Exp $ */ +/* $Id: mdoc_macro.c,v 1.115 2012/01/05 00:43:51 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010 Ingo Schwarze @@ -228,7 +228,6 @@ mdoc_macroend(struct mdoc *m) static enum mdoct lookup(enum mdoct from, const char *p) { - /* FIXME: make -diag lists be un-PARSED. */ if ( ! (MDOC_PARSED & mdoc_macros[from].flags)) return(MDOC_MAX); @@ -984,7 +983,7 @@ in_line(MACRO_PROT_ARGS) static int blk_full(MACRO_PROT_ARGS) { - int la, nl; + int la, nl, nparsed; struct mdoc_arg *arg; struct mdoc_node *head; /* save of head macro */ struct mdoc_node *body; /* save of body macro */ @@ -1039,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. */ @@ -1146,7 +1153,8 @@ blk_full(MACRO_PROT_ARGS) continue; } - ntok = ARGS_QWORD == ac ? MDOC_MAX : lookup(tok, p); + ntok = nparsed || ARGS_QWORD == ac ? + MDOC_MAX : lookup(tok, p); if (MDOC_MAX == ntok) { if ( ! dword(m, line, la, p, DELIM_MAX))