summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-03-22 21:19:34 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-03-22 21:19:34 +0000
commite91f4bd4ab69ad8613319f946e49cdd019cb80f1 (patch)
tree6d6a6122e05badb84b91269fe93ecc4fb4ec9977
parent271169c73debe731d94df1faf7ff1d89c6af9bba (diff)
downloadmandoc-e91f4bd4ab69ad8613319f946e49cdd019cb80f1.tar.gz
mandoc-e91f4bd4ab69ad8613319f946e49cdd019cb80f1.tar.zst
mandoc-e91f4bd4ab69ad8613319f946e49cdd019cb80f1.zip
Fixed Bd -compact.
Fixed vspace before Bd and Bl.
-rw-r--r--Makefile2
-rw-r--r--manuals.75
-rw-r--r--term.c59
3 files changed, 42 insertions, 24 deletions
diff --git a/Makefile b/Makefile
index ebbeb521..5837b991 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,7 @@ INSTALL_DATA = install -m 0444
INSTALL_LIB = install -m 0644
INSTALL_MAN = $(INSTALL_DATA)
-VERSION = 1.6.9
+VERSION = 1.6.10
VDATE = 22 March 2009
VFLAGS = -DVERSION=\"$(VERSION)\"
diff --git a/manuals.7 b/manuals.7
index 299a1a28..318441ec 100644
--- a/manuals.7
+++ b/manuals.7
@@ -72,7 +72,8 @@ to see the specific section manual (section 1, in this example):
.\" DISPLAY
.Bd -literal -offset indent
% apropos myname
-myname (1) - some description here
+myname (1) - utility description
+myname (3) - library description
% man \-s 1 myname
.Ed
.\" SUBSECTION
@@ -229,7 +230,7 @@ publications, please use the
block macros.
.\" SUBSECTION
.Ss Formatting
-.Em Don't style your manual.
+.Em Don't style your manual.
Give it meaningful content. The front-end will worry about formatting
and style.
.\" SECTION
diff --git a/term.c b/term.c
index 2ec2390b..a5ea91af 100644
--- a/term.c
+++ b/term.c
@@ -1,4 +1,4 @@
-/* $Id: term.c,v 1.67 2009/03/21 13:47:02 kristaps Exp $ */
+/* $Id: term.c,v 1.68 2009/03/22 21:19:34 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@openbsd.org>
*
@@ -98,6 +98,9 @@ static int arg_getattr(int, const struct mdoc_node *);
static size_t arg_offset(const struct mdoc_argv *);
static size_t arg_width(const struct mdoc_argv *, int);
static int arg_listtype(const struct mdoc_node *);
+static int fmt_block_vspace(struct termp *,
+ const struct mdoc_node *,
+ const struct mdoc_node *);
/*
* What follows describes prefix and postfix operations for the abstract
@@ -430,6 +433,36 @@ arg_getattrs(const int *keys, int *vals,
/* ARGSUSED */
static int
+fmt_block_vspace(struct termp *p,
+ const struct mdoc_node *bl,
+ const struct mdoc_node *node)
+{
+ const struct mdoc_node *n;
+
+ term_newln(p);
+
+ if (arg_hasattr(MDOC_Compact, bl))
+ return(1);
+
+ for (n = node; n; n = n->parent) {
+ if (MDOC_BLOCK != n->type)
+ continue;
+ if (MDOC_Ss == n->tok)
+ break;
+ if (MDOC_Sh == n->tok)
+ break;
+ if (NULL == n->prev)
+ continue;
+ term_vspace(p);
+ break;
+ }
+
+ return(1);
+}
+
+
+/* ARGSUSED */
+static int
termp_dq_pre(DECL_ARGS)
{
@@ -457,19 +490,6 @@ termp_dq_post(DECL_ARGS)
/* ARGSUSED */
static int
-termp_it_pre_block(DECL_ARGS)
-{
-
- term_newln(p);
- if ( ! arg_hasattr(MDOC_Compact, node->parent->parent))
- term_vspace(p);
-
- return(1);
-}
-
-
-/* ARGSUSED */
-static int
termp_it_pre(DECL_ARGS)
{
const struct mdoc_node *bl, *n;
@@ -478,7 +498,7 @@ termp_it_pre(DECL_ARGS)
size_t width, offset;
if (MDOC_BLOCK == node->type)
- return(termp_it_pre_block(p, pair, meta, node));
+ return(fmt_block_vspace(p, node->parent->parent, node));
bl = node->parent->parent->parent;
@@ -1265,12 +1285,9 @@ termp_bd_pre(DECL_ARGS)
* line. Blank lines are allowed.
*/
- if (MDOC_BLOCK == node->type) {
- /* FIXME: parent prev? */
- if (node->prev)
- term_vspace(p);
- return(1);
- } else if (MDOC_BODY != node->type)
+ if (MDOC_BLOCK == node->type)
+ return(fmt_block_vspace(p, node, node));
+ else if (MDOC_BODY != node->type)
return(1);
if (NULL == node->parent->args)