=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/tbl_data.c,v retrieving revision 1.4 retrieving revision 1.5 diff -c -r1.4 -r1.5 *** src/usr.bin/mandoc/tbl_data.c 2011/01/04 22:28:17 1.4 --- src/usr.bin/mandoc/tbl_data.c 2011/01/09 14:30:48 1.5 *************** *** 1,4 **** ! /* $Id: tbl_data.c,v 1.4 2011/01/04 22:28:17 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * --- 1,4 ---- ! /* $Id: tbl_data.c,v 1.5 2011/01/09 14:30:48 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * *************** *** 41,50 **** else if (NULL == dp->last) cp = dp->layout->first; ! /* Skip over spanners to data formats. */ while (cp && (TBL_CELL_VERT == cp->pos || ! TBL_CELL_DVERT == cp->pos)) cp = cp->next; dat = mandoc_calloc(1, sizeof(struct tbl_dat)); --- 41,54 ---- else if (NULL == dp->last) cp = dp->layout->first; ! /* ! * Skip over spanners and vertical lines to data formats, since ! * we want to match data with data layout cells in the header. ! */ while (cp && (TBL_CELL_VERT == cp->pos || ! TBL_CELL_DVERT == cp->pos || ! TBL_CELL_SPAN == cp->pos)) cp = cp->next; dat = mandoc_calloc(1, sizeof(struct tbl_dat)); *************** *** 104,122 **** return(1); } int tbl_cdata(struct tbl_node *tbl, int ln, const char *p) { struct tbl_dat *dat; size_t sz; ! if (0 == strcmp(p, "T}")) { ! tbl->part = TBL_PART_DATA; ! return(1); ! } dat = tbl->last_span->last; dat->pos = TBL_DATA_DATA; if (dat->string) { sz = strlen(p) + strlen(dat->string) + 2; --- 108,139 ---- return(1); } + /* ARGSUSED */ int tbl_cdata(struct tbl_node *tbl, int ln, const char *p) { struct tbl_dat *dat; size_t sz; + int pos; ! pos = 0; dat = tbl->last_span->last; dat->pos = TBL_DATA_DATA; + + if (p[pos] == 'T' && p[pos + 1] == '}') { + pos += 2; + if (p[pos] == tbl->opts.tab) { + tbl->part = TBL_PART_DATA; + pos++; + return(data(tbl, tbl->last_span, ln, p, &pos)); + } else if ('\0' == p[pos]) { + tbl->part = TBL_PART_DATA; + return(1); + } + + /* Fallthrough: T} is part of a word. */ + } if (dat->string) { sz = strlen(p) + strlen(dat->string) + 2;