summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--out.c2
-rw-r--r--tbl.712
-rw-r--r--tbl_data.c6
-rw-r--r--tbl_html.c14
-rw-r--r--tbl_layout.c10
-rw-r--r--tbl_term.c3
6 files changed, 40 insertions, 7 deletions
diff --git a/out.c b/out.c
index 79a0c4d2..ad16015e 100644
--- a/out.c
+++ b/out.c
@@ -453,6 +453,8 @@ tblcalc_data(struct rofftbl *tbl, struct roffcol *col,
case (TBL_CELL_NUMBER):
tblcalc_number(tbl, col, tp, dp);
break;
+ case (TBL_CELL_DOWN):
+ break;
default:
abort();
/* NOTREACHED */
diff --git a/tbl.7 b/tbl.7
index abc2ba3a..f9e9b434 100644
--- a/tbl.7
+++ b/tbl.7
@@ -209,17 +209,23 @@ Justify a number around its last decimal point.
If the decimal point is not found on the number, it's assumed to trail
the number.
.It Cm s
-Span columns from the last non-span data cell.
+Horizontally span columns from the last non-
+.Ns Cm s
+data cell.
It is an error if spanning columns follow a
.Cm \-
or
.Cm \(ba
cell, or come first.
+This option is not supported by
+.Xr mandoc 1 .
.It Cm a
Left-justify a literal string and pad with one space.
.It Cm ^
-This option is not supported by
-.Xr mandoc 1 .
+Vertically span rows from the last non-
+.Ns Cm ^
+data cell.
+It is an error to invoke a vertical span on the first layout row.
.It Cm \-
Replace the data cell (its contents will be lost) with a single
horizontal line.
diff --git a/tbl_data.c b/tbl_data.c
index b4da8fcd..1a0d06ff 100644
--- a/tbl_data.c
+++ b/tbl_data.c
@@ -122,7 +122,8 @@ data(struct tbl_node *tbl, struct tbl_span *dp,
dat->pos = TBL_DATA_DATA;
if (TBL_CELL_HORIZ == dat->layout->pos ||
- TBL_CELL_DHORIZ == dat->layout->pos)
+ TBL_CELL_DHORIZ == dat->layout->pos ||
+ TBL_CELL_DOWN == dat->layout->pos)
if (TBL_DATA_DATA == dat->pos && '\0' != *dat->string)
TBL_MSG(tbl, MANDOCERR_TBLIGNDATA, ln, sv);
@@ -165,6 +166,9 @@ tbl_cdata(struct tbl_node *tbl, int ln, const char *p)
} else
dat->string = mandoc_strdup(p);
+ if (TBL_CELL_DOWN == dat->layout->pos)
+ TBL_MSG(tbl, MANDOCERR_TBLIGNDATA, ln, pos);
+
return(0);
}
diff --git a/tbl_html.c b/tbl_html.c
index e662136a..7fafe35a 100644
--- a/tbl_html.c
+++ b/tbl_html.c
@@ -104,10 +104,18 @@ print_tbl(struct html *h, const struct tbl_span *sp)
PAIR_STYLE_INIT(&tag, h);
tt = print_otag(h, TAG_TD, 1, &tag);
- if (dp && dp->string)
- print_text(h, dp->string);
- if (dp)
+ if (dp) {
+ switch (dp->layout->pos) {
+ case (TBL_CELL_DOWN):
+ break;
+ default:
+ if (NULL == dp->string)
+ break;
+ print_text(h, dp->string);
+ break;
+ }
dp = dp->next;
+ }
print_tagq(h, tt);
}
diff --git a/tbl_layout.c b/tbl_layout.c
index 25b77e1c..7063aaff 100644
--- a/tbl_layout.c
+++ b/tbl_layout.c
@@ -220,6 +220,16 @@ cell(struct tbl_node *tbl, struct tbl_row *rp,
}
}
+ /*
+ * If a vertical spanner is found, we may not be in the first
+ * row.
+ */
+
+ if (TBL_CELL_DOWN == c && rp == tbl->first_row) {
+ TBL_MSG(tbl, MANDOCERR_TBLLAYOUT, ln, *pos);
+ return(0);
+ }
+
(*pos)++;
/* Extra check for the double-vertical. */
diff --git a/tbl_term.c b/tbl_term.c
index d42483c3..dc6ff8d9 100644
--- a/tbl_term.c
+++ b/tbl_term.c
@@ -305,6 +305,9 @@ tbl_data(struct termp *tp, const struct tbl *tbl,
case (TBL_CELL_NUMBER):
tbl_number(tp, tbl, dp, col);
break;
+ case (TBL_CELL_DOWN):
+ tbl_char(tp, ASCII_NBRSP, col->width);
+ break;
default:
abort();
/* NOTREACHED */