summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-11-10 21:56:43 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-11-10 21:56:43 +0000
commita950771d89277414385418e80da13f9c128ab7f4 (patch)
treef33d36894215157e2a066290ec932d48665193ac
parentc7b804e53df51b193077ea392efb3131891130e7 (diff)
downloadmandoc-a950771d89277414385418e80da13f9c128ab7f4.tar.gz
add required vertical spacing before lists that begin
at the beginning of the first item of an enclosing list right at the beginning of a new section or subsection; minibug reported by Steffen Nurpmeso <sdaoden at yandex dot com>
-rw-r--r--mdoc_term.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index 78c81b32..c115e0eb 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -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)
- return;
- if (MDOC_Sh == 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 (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. */