From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id 9d313c02 for ; Sun, 19 Aug 2018 14:32:51 -0500 (EST) Date: Sun, 19 Aug 2018 14:32:51 -0500 (EST) X-Mailinglist: mandoc-source Reply-To: source@mandoc.bsd.lv MIME-Version: 1.0 From: schwarze@mandoc.bsd.lv To: source@mandoc.bsd.lv Subject: mandoc: do not print horizontal lines inside vertical spans X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Message-Id: Log Message: ----------- do not print horizontal lines inside vertical spans Modified Files: -------------- mandoc: tbl_term.c Revision Data ------------- Index: tbl_term.c =================================================================== RCS file: /home/cvs/mandoc/mandoc/tbl_term.c,v retrieving revision 1.58 retrieving revision 1.59 diff -Ltbl_term.c -Ltbl_term.c -u -p -r1.58 -r1.59 --- tbl_term.c +++ tbl_term.c @@ -460,13 +460,11 @@ tbl_hrule(struct termp *tp, const struct const struct tbl_cell *cp, *cpn, *cpp; const struct roffcol *col; int vert; - char line, cross; + char cross, line, stdcross, stdline; - line = (kind < 2 && TBL_SPAN_DHORIZ == sp->pos) ? '=' : '-'; - cross = (kind < 3) ? '+' : '-'; + stdline = (kind < 2 && TBL_SPAN_DHORIZ == sp->pos) ? '=' : '-'; + stdcross = (kind < 3) ? '+' : '-'; - if (kind) - term_word(tp, "+"); cp = sp->layout->first; cpp = kind || sp->prev == NULL ? NULL : sp->prev->layout->first; if (cpp == cp) @@ -474,8 +472,18 @@ tbl_hrule(struct termp *tp, const struct cpn = kind > 1 || sp->next == NULL ? NULL : sp->next->layout->first; if (cpn == cp) cpn = NULL; + if (kind) + term_word(tp, + cpn == NULL || cpn->pos != TBL_CELL_DOWN ? "+" : "|"); for (;;) { col = tp->tbl.cols + cp->col; + if (cpn == NULL || cpn->pos != TBL_CELL_DOWN) { + line = stdline; + cross = stdcross; + } else { + line = ' '; + cross = (kind < 3) ? '|' : ' '; + } tbl_char(tp, line, col->width + col->spacing / 2); vert = cp->vert; if ((cp = cp->next) == NULL) @@ -490,6 +498,11 @@ tbl_hrule(struct termp *tp, const struct vert = cpn->vert; cpn = cpn->next; } + if (cpn == NULL || cpn->pos != TBL_CELL_DOWN) { + line = stdline; + cross = stdcross; + } else + line = ' '; if (sp->opts->opts & TBL_OPT_ALLBOX && !vert) vert = 1; if (col->spacing) @@ -500,7 +513,8 @@ tbl_hrule(struct termp *tp, const struct tbl_char(tp, line, (col->spacing - 3) / 2); } if (kind) { - term_word(tp, "+"); + term_word(tp, + cpn == NULL || cpn->pos != TBL_CELL_DOWN ? "+" : "|"); term_flushln(tp); } } -- To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv