=================================================================== RCS file: /cvs/mandoc/mdoc_term.c,v retrieving revision 1.366 retrieving revision 1.367 diff -u -p -r1.366 -r1.367 --- mandoc/mdoc_term.c 2018/04/05 09:17:26 1.366 +++ mandoc/mdoc_term.c 2018/04/11 17:11:13 1.367 @@ -1,7 +1,7 @@ -/* $Id: mdoc_term.c,v 1.366 2018/04/05 09:17:26 schwarze Exp $ */ +/* $Id: mdoc_term.c,v 1.367 2018/04/11 17:11:13 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons - * Copyright (c) 2010, 2012-2017 Ingo Schwarze + * Copyright (c) 2010, 2012-2018 Ingo Schwarze * Copyright (c) 2013 Franco Fichtner * * Permission to use, copy, modify, and distribute this software for any @@ -283,7 +283,9 @@ 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) + while (n != NULL && + (n->type == ROFFT_COMMENT || + n->flags & NODE_NOPRT)) n = n->next; if (n != NULL) { if (n->tok != MDOC_Sh) @@ -312,7 +314,7 @@ print_mdoc_node(DECL_ARGS) struct termpair npair; size_t offset, rmargin; - if (n->flags & NODE_NOPRT) + if (n->type == ROFFT_COMMENT || n->flags & NODE_NOPRT) return; chld = 1; @@ -567,7 +569,9 @@ print_bvspace(struct termp *p, /* Do not vspace directly after Ss/Sh. */ nn = n; - while (nn->prev != NULL && nn->prev->flags & NODE_NOPRT) + while (nn->prev != NULL && + (nn->prev->type == ROFFT_COMMENT || + nn->prev->flags & NODE_NOPRT)) nn = nn->prev; while (nn->prev == NULL) { do { @@ -1550,7 +1554,8 @@ termp_ss_pre(DECL_ARGS) case ROFFT_BLOCK: term_newln(p); for (nn = n->prev; nn != NULL; nn = nn->prev) - if ((nn->flags & NODE_NOPRT) == 0) + if (nn->type != ROFFT_COMMENT && + (nn->flags & NODE_NOPRT) == 0) break; if (nn != NULL) term_vspace(p);