=================================================================== RCS file: /cvs/mandoc/mdoc_term.c,v retrieving revision 1.336 retrieving revision 1.337 diff -u -p -r1.336 -r1.337 --- mandoc/mdoc_term.c 2016/11/08 16:38:21 1.336 +++ mandoc/mdoc_term.c 2017/01/10 12:53:07 1.337 @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.336 2016/11/08 16:38:21 schwarze Exp $ */ +/* $Id: mdoc_term.c,v 1.337 2017/01/10 12:53:07 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2012-2016 Ingo Schwarze @@ -285,6 +285,8 @@ terminal_mdoc(void *arg, const struct roff_man *mdoc) p->defindent = 5; term_begin(p, print_mdoc_head, print_mdoc_foot, &mdoc->meta); + while (n != NULL && n->flags & NODE_NOPRT) + n = n->next; if (n != NULL) { if (n->tok != MDOC_Sh) term_vspace(p); @@ -311,6 +313,9 @@ print_mdoc_node(DECL_ARGS) struct termpair npair; size_t offset, rmargin; + if (n->flags & NODE_NOPRT) + return; + chld = 1; offset = p->offset; rmargin = p->rmargin; @@ -564,6 +569,8 @@ print_bvspace(struct termp *p, /* Do not vspace directly after Ss/Sh. */ nn = n; + while (nn->prev != NULL && nn->prev->flags & NODE_NOPRT) + nn = nn->prev; while (nn->prev == NULL) { do { nn = nn->parent; @@ -1718,11 +1725,15 @@ termp_pf_post(DECL_ARGS) static int termp_ss_pre(DECL_ARGS) { + struct roff_node *nn; switch (n->type) { case ROFFT_BLOCK: term_newln(p); - if (n->prev) + for (nn = n->prev; nn != NULL; nn = nn->prev) + if ((nn->flags & NODE_NOPRT) == 0) + break; + if (nn != NULL) term_vspace(p); break; case ROFFT_HEAD: