Fixed undocumented `-diag' where NULL list item bodies aren't followed by a vspace.
authorKristaps Dzonsons <kristaps@bsd.lv>
Tue, 21 Jul 2009 15:35:30 +0000 (15:35 +0000)
committerKristaps Dzonsons <kristaps@bsd.lv>
Tue, 21 Jul 2009 15:35:30 +0000 (15:35 +0000)
mdoc_term.c

index 5ad5de67e02aaa2d6abda3b7740b98c9b2c6c982..4f8d776b8a2217d952313f59b4970b94f14c01c3 100644 (file)
@@ -1,4 +1,4 @@
-/*     $Id: mdoc_term.c,v 1.54 2009/07/21 15:03:37 kristaps Exp $ */
+/*     $Id: mdoc_term.c,v 1.55 2009/07/21 15:35:30 kristaps Exp $ */
 /*
  * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
  *
@@ -689,14 +689,25 @@ fmt_block_vspace(struct termp *p,
        }
 
        /* 
-        * XXX - not documented: a `-column' does not ever assert
-        * vertical space within the list.
+        * XXX - not documented: a `-column' does not ever assert vspace
+        * within the list.
         */
 
        if (arg_hasattr(MDOC_Column, bl))
                if (node->prev && MDOC_It == node->prev->tok)
                        return;
 
+       /*
+        * XXX - not documented: a `-diag' without a body does not
+        * assert a vspace prior to the next element. 
+        */
+       if (arg_hasattr(MDOC_Diag, bl)) 
+               if (node->prev && MDOC_It == node->prev->tok) {
+                       assert(node->prev->body);
+                       if (NULL == node->prev->body->child)
+                               return;
+               }
+
        term_vspace(p);
 }