diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2012-05-26 20:03:35 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2012-05-26 20:03:35 +0000 |
commit | 149fd6bc0536e661f7082e1733980c38c237ad7a (patch) | |
tree | e860d0298f1d8ebc756df76bf3881f1e6fc51033 /usr.bin/mandoc/tbl_html.c | |
parent | a620e0445a55e8efca115d298e4f6ef6c8bb0845 (diff) |
Do not handle vertical lines as additional tbl(7) columns,
instead save their properties with the following column.
This simplifies layout parsing and saves a lot of code
related to column handling.
At output time, print all white space and vertical lines
separating columns before printing the following column,
and none after printing the preceding column, considerably
simplifying white space handling and width calculations.
No functional change, but it saves 150 lines of code,
and it allows the next patch to tbl_term.c, tbl_literal().
Diffstat (limited to 'usr.bin/mandoc/tbl_html.c')
-rw-r--r-- | usr.bin/mandoc/tbl_html.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/usr.bin/mandoc/tbl_html.c b/usr.bin/mandoc/tbl_html.c index 5cb4f943bd1..81e954c2559 100644 --- a/usr.bin/mandoc/tbl_html.c +++ b/usr.bin/mandoc/tbl_html.c @@ -1,4 +1,4 @@ -/* $Id: tbl_html.c,v 1.5 2011/09/18 15:54:48 schwarze Exp $ */ +/* $Id: tbl_html.c,v 1.6 2012/05/26 20:03:34 schwarze Exp $ */ /* * Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -119,20 +119,12 @@ print_tbl(struct html *h, const struct tbl_span *sp) print_stagq(h, tt); print_otag(h, TAG_TD, 0, NULL); - switch (hp->pos) { - case (TBL_HEAD_VERT): - /* FALLTHROUGH */ - case (TBL_HEAD_DVERT): - continue; - case (TBL_HEAD_DATA): - if (NULL == dp) - break; - if (TBL_CELL_DOWN != dp->layout->pos) - if (dp->string) - print_text(h, dp->string); - dp = dp->next; + if (NULL == dp) break; - } + if (TBL_CELL_DOWN != dp->layout->pos) + if (dp->string) + print_text(h, dp->string); + dp = dp->next; } break; } |