summaryrefslogtreecommitdiffstats
path: root/tbl_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-03-28 23:26:25 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-03-28 23:26:25 +0000
commit1f5b9d128ee296272c97a8e1a191d09c75b10fd1 (patch)
treeb9f54fc16573c2cb8d4c6e72a6a8d5ee41bfae15 /tbl_term.c
parent3807ee23c5f7bfedf0aeb8a013b458325092265b (diff)
downloadmandoc-1f5b9d128ee296272c97a8e1a191d09c75b10fd1.tar.gz
Allow leading and trailing vertical lines,
and format them in the same way as groff. While here, do not require whitespace before vertical lines in layout specifications. Issues found by bentley@ in mpv(1).
Diffstat (limited to 'tbl_term.c')
-rw-r--r--tbl_term.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tbl_term.c b/tbl_term.c
index 908daa60..5cd5e65d 100644
--- a/tbl_term.c
+++ b/tbl_term.c
@@ -1,7 +1,7 @@
/* $Id$ */
/*
* Copyright (c) 2009, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2011, 2012 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2011, 2012, 2014 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -105,7 +105,8 @@ term_tbl(struct termp *tp, const struct tbl_span *sp)
/* Vertical frame at the start of each row. */
- if (TBL_OPT_BOX & sp->opts->opts || TBL_OPT_DBOX & sp->opts->opts)
+ if ((TBL_OPT_BOX | TBL_OPT_DBOX) & sp->opts->opts ||
+ sp->head->vert)
term_word(tp, TBL_SPAN_HORIZ == sp->pos ||
TBL_SPAN_DHORIZ == sp->pos ? "+" : "|");
@@ -159,7 +160,8 @@ term_tbl(struct termp *tp, const struct tbl_span *sp)
/* Vertical frame at the end of each row. */
- if (TBL_OPT_BOX & sp->opts->opts || TBL_OPT_DBOX & sp->opts->opts)
+ if ((TBL_OPT_BOX | TBL_OPT_DBOX) & sp->opts->opts ||
+ sp->layout->vert)
term_word(tp, TBL_SPAN_HORIZ == sp->pos ||
TBL_SPAN_DHORIZ == sp->pos ? "+" : " |");
term_flushln(tp);