+ dat->pos = TBL_DATA_NDHORIZ;
+ else
+ dat->pos = TBL_DATA_DATA;
+
+ if ((dat->layout->pos == TBL_CELL_HORIZ ||
+ dat->layout->pos == TBL_CELL_DHORIZ ||
+ dat->layout->pos == TBL_CELL_DOWN) &&
+ dat->pos == TBL_DATA_DATA && *dat->string != '\0')
+ mandoc_msg(MANDOCERR_TBLDATA_SPAN,
+ tbl->parse, ln, sv, dat->string);
+}
+
+int
+tbl_cdata(struct tbl_node *tbl, int ln, const char *p, int pos)
+{
+ struct tbl_dat *dat;
+ size_t sz;
+
+ dat = tbl->last_span->last;
+
+ if (p[pos] == 'T' && p[pos + 1] == '}') {
+ pos += 2;
+ if (p[pos] == tbl->opts.tab) {
+ tbl->part = TBL_PART_DATA;
+ pos++;
+ while (p[pos] != '\0')
+ getdata(tbl, tbl->last_span, ln, p, &pos);
+ return(1);
+ } else if (p[pos] == '\0') {
+ tbl->part = TBL_PART_DATA;
+ return(1);
+ }
+
+ /* Fallthrough: T} is part of a word. */
+ }
+
+ dat->pos = TBL_DATA_DATA;
+
+ if (dat->string != NULL) {
+ sz = strlen(p + pos) + strlen(dat->string) + 2;
+ dat->string = mandoc_realloc(dat->string, sz);
+ (void)strlcat(dat->string, " ", sz);
+ (void)strlcat(dat->string, p + pos, sz);
+ } else
+ dat->string = mandoc_strdup(p + pos);
+
+ if (dat->layout->pos == TBL_CELL_DOWN)
+ mandoc_msg(MANDOCERR_TBLDATA_SPAN, tbl->parse,
+ ln, pos, dat->string);
+
+ return(0);