=================================================================== RCS file: /cvs/mandoc/mdoc_term.c,v retrieving revision 1.288 retrieving revision 1.289 diff -u -p -r1.288 -r1.289 --- mandoc/mdoc_term.c 2014/10/30 20:10:02 1.288 +++ mandoc/mdoc_term.c 2014/11/10 21:56:43 1.289 @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.288 2014/10/30 20:10:02 schwarze Exp $ */ +/* $Id: mdoc_term.c,v 1.289 2014/11/10 21:56:43 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2012, 2013, 2014 Ingo Schwarze @@ -572,16 +572,18 @@ print_bvspace(struct termp *p, /* Do not vspace directly after Ss/Sh. */ - for (nn = n; nn; nn = nn->parent) { - if (MDOC_BLOCK != nn->type) - continue; - if (MDOC_Ss == nn->tok) + nn = n; + while (nn->prev == NULL) { + do { + nn = nn->parent; + if (nn->type == MDOC_ROOT) + return; + } while (nn->type != MDOC_BLOCK); + if (nn->tok == MDOC_Sh || nn->tok == MDOC_Ss) return; - if (MDOC_Sh == nn->tok) - return; - if (NULL == nn->prev) - continue; - break; + if (nn->tok == MDOC_It && + nn->parent->parent->norm->Bl.type != LIST_item) + break; } /* A `-column' does not assert vspace within the list. */