aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--out.c4
-rw-r--r--tbl.716
-rw-r--r--tbl_data.c8
-rw-r--r--tbl_html.c16
-rw-r--r--tbl_layout.c12
-rw-r--r--tbl_term.c5
6 files changed, 47 insertions, 14 deletions
diff --git a/out.c b/out.c
index 46f87098..155957ea 100644
--- a/out.c
+++ b/out.c
@@ -1,4 +1,4 @@
-/* $Id: out.c,v 1.34 2011/01/10 15:31:00 kristaps Exp $ */
+/* $Id: out.c,v 1.35 2011/01/11 14:12:01 kristaps Exp $ */
/*
* Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -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 683e80f1..5adc6c5e 100644
--- a/tbl.7
+++ b/tbl.7
@@ -1,4 +1,4 @@
-.\" $Id: tbl.7,v 1.8 2011/01/10 14:40:30 kristaps Exp $
+.\" $Id: tbl.7,v 1.9 2011/01/11 14:12:01 kristaps Exp $
.\"
.\" Copyright (c) 2010 Kristaps Dzonsons <kristaps@bsd.lv>
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: January 10 2011 $
+.Dd $Mdocdate: January 11 2011 $
.Dt TBL 7
.Os
.Sh NAME
@@ -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 e68cd4a7..980a584c 100644
--- a/tbl_data.c
+++ b/tbl_data.c
@@ -1,4 +1,4 @@
-/* $Id: tbl_data.c,v 1.18 2011/01/10 15:31:00 kristaps Exp $ */
+/* $Id: tbl_data.c,v 1.19 2011/01/11 14:12:01 kristaps Exp $ */
/*
* Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -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 7594dfc9..ebad7c77 100644
--- a/tbl_html.c
+++ b/tbl_html.c
@@ -1,4 +1,4 @@
-/* $Id: tbl_html.c,v 1.5 2011/01/06 12:31:39 kristaps Exp $ */
+/* $Id: tbl_html.c,v 1.6 2011/01/11 14:12:01 kristaps Exp $ */
/*
* Copyright (c) 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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 b3e81467..dd30e5ea 100644
--- a/tbl_layout.c
+++ b/tbl_layout.c
@@ -1,4 +1,4 @@
-/* $Id: tbl_layout.c,v 1.15 2011/01/10 15:31:00 kristaps Exp $ */
+/* $Id: tbl_layout.c,v 1.16 2011/01/11 14:12:01 kristaps Exp $ */
/*
* Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -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 b93cae3e..57fc3290 100644
--- a/tbl_term.c
+++ b/tbl_term.c
@@ -1,4 +1,4 @@
-/* $Id: tbl_term.c,v 1.17 2011/01/10 14:56:06 kristaps Exp $ */
+/* $Id: tbl_term.c,v 1.18 2011/01/11 14:12:01 kristaps Exp $ */
/*
* Copyright (c) 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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 */