=================================================================== RCS file: /cvs/mandoc/mdoc_macro.c,v retrieving revision 1.119 retrieving revision 1.122 diff -u -p -r1.119 -r1.122 --- mandoc/mdoc_macro.c 2012/11/17 00:26:33 1.119 +++ mandoc/mdoc_macro.c 2013/09/15 18:26:46 1.122 @@ -1,4 +1,4 @@ -/* $Id: mdoc_macro.c,v 1.119 2012/11/17 00:26:33 schwarze Exp $ */ +/* $Id: mdoc_macro.c,v 1.122 2013/09/15 18:26:46 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010, 2012 Ingo Schwarze @@ -612,7 +612,8 @@ dword(struct mdoc *mdoc, int line, */ else if (DELIM_CLOSE == d && mdoc->last->prev && - mdoc->last->prev->tok != MDOC_No) + mdoc->last->prev->tok != MDOC_No && + mdoc->last->parent->tok != MDOC_Fd) mdoc->last->flags |= MDOC_DELIMC; return(1); @@ -791,6 +792,9 @@ blk_exp_close(MACRO_PROT_ARGS) return(0); flushed = 1; } + + mdoc->flags &= ~MDOC_NEWLINE; + if ( ! mdoc_macro(mdoc, ntok, line, lastarg, pos, buf)) return(0); break; @@ -1758,16 +1762,22 @@ phrase(struct mdoc *mdoc, int line, int ppos, char *bu static int phrase_ta(MACRO_PROT_ARGS) { + struct mdoc_node *n; int la; enum mdoct ntok; enum margserr ac; char *p; - /* - * FIXME: this is overly restrictive: if the `Ta' is unexpected, - * it should simply error out with ARGSLOST. - */ + /* Make sure we are in a column list or ignore this macro. */ + n = mdoc->last; + while (NULL != n && MDOC_Bl != n->tok) + n = n->parent; + if (NULL == n || LIST_column != n->norm->Bl.type) { + mdoc_pmsg(mdoc, line, ppos, MANDOCERR_STRAYTA); + return(1); + } + /* Advance to the next column. */ if ( ! rew_sub(MDOC_BODY, mdoc, MDOC_It, line, ppos)) return(0); if ( ! mdoc_body_alloc(mdoc, line, ppos, MDOC_It))