=================================================================== RCS file: /cvs/mandoc/mdoc_term.c,v retrieving revision 1.62 retrieving revision 1.66 diff -u -p -r1.62 -r1.66 --- mandoc/mdoc_term.c 2009/07/24 12:52:28 1.62 +++ mandoc/mdoc_term.c 2009/08/10 10:09:51 1.66 @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.62 2009/07/24 12:52:28 kristaps Exp $ */ +/* $Id: mdoc_term.c,v 1.66 2009/08/10 10:09:51 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -26,6 +26,9 @@ #include "term.h" #include "mdoc.h" +#define INDENT 5 +#define HALFINDENT 3 + /* FIXME: macro arguments can be escaped. */ #define TTYPE_PROG 0 @@ -674,6 +677,7 @@ fmt_block_vspace(struct termp *p, if (MDOC_Bl == bl->tok && arg_hasattr(MDOC_Compact, bl)) return; + assert(node); /* * Search through our prior nodes. If we follow a `Ss' or `Sh', @@ -1397,10 +1401,18 @@ termp_fd_post(DECL_ARGS) static int termp_sh_pre(DECL_ARGS) { - + /* + * XXX: undocumented: using two `Sh' macros in sequence has no + * vspace between calls, only a newline. + */ switch (node->type) { - case (MDOC_HEAD): + case (MDOC_BLOCK): + if (node->prev && MDOC_Sh == node->prev->tok) + if (NULL == node->prev->body->child) + break; term_vspace(p); + break; + case (MDOC_HEAD): pair->flag |= ttypes[TTYPE_SECTION]; break; case (MDOC_BODY):