=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mdoc_term.c,v retrieving revision 1.265 retrieving revision 1.266 diff -u -r1.265 -r1.266 --- src/usr.bin/mandoc/mdoc_term.c 2018/04/05 09:16:45 1.265 +++ src/usr.bin/mandoc/mdoc_term.c 2018/04/11 17:10:35 1.266 @@ -1,7 +1,7 @@ -/* $OpenBSD: mdoc_term.c,v 1.265 2018/04/05 09:16:45 schwarze Exp $ */ +/* $OpenBSD: mdoc_term.c,v 1.266 2018/04/11 17:10:35 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 @@ -281,7 +281,9 @@ 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) @@ -310,7 +312,7 @@ struct termpair npair; size_t offset, rmargin; - if (n->flags & NODE_NOPRT) + if (n->type == ROFFT_COMMENT || n->flags & NODE_NOPRT) return; chld = 1; @@ -565,7 +567,9 @@ /* 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 { @@ -1548,7 +1552,8 @@ 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);