diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2015-03-06 15:48:52 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2015-03-06 15:48:52 +0000 |
commit | ece1130543926ea0ba9501d03e83d5b9b3397ca1 (patch) | |
tree | 9c7ad63c90c23aafd763f2edfc1899d2604e8f3f | |
parent | 266a26007c7adee2f5afdcf2daad4e88a6a28775 (diff) | |
download | mandoc-ece1130543926ea0ba9501d03e83d5b9b3397ca1.tar.gz |
Fix vertical spacing at the beginning of tables.
man(7) always prints a blank line, mdoc(7) doesn't.
Problem in mdoc(7) reported by kristaps@.
mdoc(7) part of the patch tested by kristaps@.
-rw-r--r-- | man_term.c | 8 | ||||
-rw-r--r-- | mdoc_term.c | 2 | ||||
-rw-r--r-- | tbl_term.c | 3 |
3 files changed, 4 insertions, 9 deletions
@@ -945,12 +945,8 @@ print_man_node(DECL_ARGS) p->flags |= TERMP_NOSPACE; return; case MAN_TBL: - /* - * Tables are preceded by a newline. Then process a - * table line, which will cause line termination, - */ - if (n->span->prev == NULL) - term_newln(p); + if (p->tbl.cols == NULL) + term_vspace(p); term_tbl(p, n->span); return; default: diff --git a/mdoc_term.c b/mdoc_term.c index 33591c38..0f23ec15 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -348,6 +348,8 @@ print_mdoc_node(DECL_ARGS) p->flags |= TERMP_NOSPACE; break; case MDOC_TBL: + if (p->tbl.cols == NULL) + term_newln(p); term_tbl(p, n->span); break; default: @@ -66,9 +66,6 @@ term_tbl(struct termp *tp, const struct tbl_span *sp) size_t rmargin, maxrmargin, tsz; int ic, horiz, spans, vert; - if (tp->tbl.cols == NULL) - term_flushln(tp); - rmargin = tp->rmargin; maxrmargin = tp->maxrmargin; |