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 | 87903ce8d582f66d32cc69fd2ddaaecdd1ba7110 (patch) | |
tree | 0262da45b6982ded2413c728986eaec08c03b902 | |
parent | a46a5eca6f395c86f507c20f47ab147378f70f00 (diff) | |
download | mandoc-87903ce8d582f66d32cc69fd2ddaaecdd1ba7110.tar.gz mandoc-87903ce8d582f66d32cc69fd2ddaaecdd1ba7110.tar.zst mandoc-87903ce8d582f66d32cc69fd2ddaaecdd1ba7110.zip |
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 | 10 | ||||
-rw-r--r-- | mdoc_term.c | 4 | ||||
-rw-r--r-- | tbl_term.c | 5 |
3 files changed, 7 insertions, 12 deletions
@@ -1,4 +1,4 @@ -/* $Id: man_term.c,v 1.168 2015/01/30 22:04:44 schwarze Exp $ */ +/* $Id: man_term.c,v 1.169 2015/03/06 15:48:52 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org> @@ -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 acba3829..20c47d66 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.312 2015/03/06 13:09:07 schwarze Exp $ */ +/* $Id: mdoc_term.c,v 1.313 2015/03/06 15:48:52 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010, 2012-2015 Ingo Schwarze <schwarze@openbsd.org> @@ -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: @@ -1,4 +1,4 @@ -/* $Id: tbl_term.c,v 1.39 2015/03/06 11:03:03 schwarze Exp $ */ +/* $Id: tbl_term.c,v 1.40 2015/03/06 15:48:53 schwarze Exp $ */ /* * Copyright (c) 2009, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011, 2012, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org> @@ -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; |