aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tbl_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-06-12 22:49:16 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-06-12 22:49:16 +0000
commit041d1eb653eba2b3b330f382737e18acbbb9beae (patch)
treef71c31d2619d3e2065dcd6e08562e866a44419ac /tbl_term.c
parent9831364abe24948f9f08ab37b9ebc3ef693cbb7c (diff)
downloadmandoc-041d1eb653eba2b3b330f382737e18acbbb9beae.tar.gz
mandoc-041d1eb653eba2b3b330f382737e18acbbb9beae.tar.zst
mandoc-041d1eb653eba2b3b330f382737e18acbbb9beae.zip
Two minor fixes for the "allbox" modifier:
1. It does not reduce explicit "||" in the layout to "|". 2. It does not cause three horizontal lines at the end of a table, even if the table ends with an explicit "_" data line.
Diffstat (limited to 'tbl_term.c')
-rw-r--r--tbl_term.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/tbl_term.c b/tbl_term.c
index 797cfbe7..9a4007f5 100644
--- a/tbl_term.c
+++ b/tbl_term.c
@@ -1,4 +1,4 @@
-/* $Id: tbl_term.c,v 1.49 2017/06/12 20:45:18 schwarze Exp $ */
+/* $Id: tbl_term.c,v 1.50 2017/06/12 22:49:16 schwarze Exp $ */
/*
* Copyright (c) 2009, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011,2012,2014,2015,2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -242,7 +242,8 @@ term_tbl(struct termp *tp, const struct tbl_span *sp)
cp = cp->next;
} else
vert = 0;
- if (sp->opts->opts & TBL_OPT_ALLBOX)
+ if (vert == 0 &&
+ sp->opts->opts & TBL_OPT_ALLBOX)
vert = 1;
if (vert == 0)
continue;
@@ -302,7 +303,9 @@ term_tbl(struct termp *tp, const struct tbl_span *sp)
free(tp->tbl.cols);
tp->tbl.cols = NULL;
tp->tcol->offset = offset;
- } else if (horiz == 0 && sp->opts->opts & TBL_OPT_ALLBOX)
+ } else if (horiz == 0 && sp->opts->opts & TBL_OPT_ALLBOX &&
+ (sp->next == NULL || sp->next->pos == TBL_SPAN_DATA ||
+ sp->next->next != NULL))
tbl_hrule(tp, sp, 1);
tp->flags &= ~TERMP_NONOSPACE;