aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2012-07-09 23:53:36 +0000
committerIngo Schwarze <schwarze@openbsd.org>2012-07-09 23:53:36 +0000
commit46e3c278c370d1404debff5aa25ae184a3e13a14 (patch)
tree980813ad358b1aac2da0a38052830a0c4d6e617a
parent1c4bd309e3fdb17789722bddac6ba8b2c1de4f42 (diff)
downloadmandoc-46e3c278c370d1404debff5aa25ae184a3e13a14.tar.gz
mandoc-46e3c278c370d1404debff5aa25ae184a3e13a14.tar.zst
mandoc-46e3c278c370d1404debff5aa25ae184a3e13a14.zip
fix -Tascii .Fd line breaking
and implement -Tman .Fd OpenBSD rev. 1.27 and 1.143, respectively
-rw-r--r--mdoc_man.c27
-rw-r--r--mdoc_term.c30
2 files changed, 37 insertions, 20 deletions
diff --git a/mdoc_man.c b/mdoc_man.c
index ffe3b60f..a82bbf51 100644
--- a/mdoc_man.c
+++ b/mdoc_man.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_man.c,v 1.28 2012/07/09 22:36:34 schwarze Exp $ */
+/* $Id: mdoc_man.c,v 1.29 2012/07/09 23:53:36 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Ingo Schwarze <schwarze@openbsd.org>
*
@@ -50,6 +50,7 @@ static void post_dl(DECL_ARGS);
static void post_enc(DECL_ARGS);
static void post_eo(DECL_ARGS);
static void post_fa(DECL_ARGS);
+static void post_fd(DECL_ARGS);
static void post_fl(DECL_ARGS);
static void post_fn(DECL_ARGS);
static void post_fo(DECL_ARGS);
@@ -73,6 +74,7 @@ static int pre_dl(DECL_ARGS);
static int pre_enc(DECL_ARGS);
static int pre_em(DECL_ARGS);
static int pre_fa(DECL_ARGS);
+static int pre_fd(DECL_ARGS);
static int pre_fl(DECL_ARGS);
static int pre_fn(DECL_ARGS);
static int pre_fo(DECL_ARGS);
@@ -124,7 +126,7 @@ static const struct manact manacts[MDOC_MAX + 1] = {
"\\fP\nutility exits 0 on success, and >0 if an error occurs."
}, /* Ex */
{ NULL, pre_fa, post_fa, NULL, NULL }, /* Fa */
- { NULL, NULL, NULL, NULL, NULL }, /* _Fd */
+ { NULL, pre_fd, post_fd, NULL, NULL }, /* Fd */
{ NULL, pre_fl, post_fl, NULL, NULL }, /* Fl */
{ NULL, pre_fn, post_fn, NULL, NULL }, /* Fn */
{ NULL, pre_ft, post_font, NULL, NULL }, /* Ft */
@@ -218,8 +220,8 @@ static const struct manact manacts[MDOC_MAX + 1] = {
{ cond_body, pre_enc, post_enc, "{", "}" }, /* Bro */
{ NULL, NULL, NULL, NULL, NULL }, /* Brc */
{ NULL, NULL, NULL, NULL, NULL }, /* _%C */
- { NULL, NULL, NULL, NULL, NULL }, /* _Es */
- { NULL, NULL, NULL, NULL, NULL }, /* _En */
+ { NULL, NULL, NULL, NULL, NULL }, /* Es */
+ { NULL, NULL, NULL, NULL, NULL }, /* En */
{ NULL, pre_ux, NULL, "DragonFly", NULL }, /* Dx */
{ NULL, NULL, NULL, NULL, NULL }, /* _%Q */
{ NULL, pre_br, NULL, NULL, NULL }, /* br */
@@ -791,6 +793,23 @@ post_fa(DECL_ARGS)
}
static int
+pre_fd(DECL_ARGS)
+{
+
+ pre_syn(n);
+ font_push('B');
+ return(1);
+}
+
+static void
+post_fd(DECL_ARGS)
+{
+
+ font_pop();
+ outflags |= MMAN_br;
+}
+
+static int
pre_fl(DECL_ARGS)
{
diff --git a/mdoc_term.c b/mdoc_term.c
index cff10571..36181778 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_term.c,v 1.240 2012/07/08 22:49:29 schwarze Exp $ */
+/* $Id: mdoc_term.c,v 1.241 2012/07/09 23:53:36 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012 Ingo Schwarze <schwarze@openbsd.org>
@@ -69,7 +69,7 @@ static void termp_an_post(DECL_ARGS);
static void termp_bd_post(DECL_ARGS);
static void termp_bk_post(DECL_ARGS);
static void termp_bl_post(DECL_ARGS);
-static void termp_d1_post(DECL_ARGS);
+static void termp_fd_post(DECL_ARGS);
static void termp_fo_post(DECL_ARGS);
static void termp_in_post(DECL_ARGS);
static void termp_it_post(DECL_ARGS);
@@ -129,8 +129,8 @@ static const struct termact termacts[MDOC_MAX] = {
{ termp_sh_pre, termp_sh_post }, /* Sh */
{ termp_ss_pre, termp_ss_post }, /* Ss */
{ termp_sp_pre, NULL }, /* Pp */
- { termp_d1_pre, termp_d1_post }, /* D1 */
- { termp_d1_pre, termp_d1_post }, /* Dl */
+ { termp_d1_pre, termp_bl_post }, /* D1 */
+ { termp_d1_pre, termp_bl_post }, /* Dl */
{ termp_bd_pre, termp_bd_post }, /* Bd */
{ NULL, NULL }, /* Ed */
{ termp_bl_pre, termp_bl_post }, /* Bl */
@@ -146,7 +146,7 @@ static const struct termact termacts[MDOC_MAX] = {
{ NULL, NULL }, /* Ev */
{ termp_ex_pre, NULL }, /* Ex */
{ termp_fa_pre, NULL }, /* Fa */
- { termp_fd_pre, NULL }, /* Fd */
+ { termp_fd_pre, termp_fd_post }, /* Fd */
{ termp_fl_pre, NULL }, /* Fl */
{ termp_fn_pre, NULL }, /* Fn */
{ termp_ft_pre, NULL }, /* Ft */
@@ -1407,6 +1407,15 @@ termp_fd_pre(DECL_ARGS)
/* ARGSUSED */
+static void
+termp_fd_post(DECL_ARGS)
+{
+
+ term_newln(p);
+}
+
+
+/* ARGSUSED */
static int
termp_sh_pre(DECL_ARGS)
{
@@ -1500,17 +1509,6 @@ termp_d1_pre(DECL_ARGS)
/* ARGSUSED */
-static void
-termp_d1_post(DECL_ARGS)
-{
-
- if (MDOC_BLOCK != n->type)
- return;
- term_newln(p);
-}
-
-
-/* ARGSUSED */
static int
termp_ft_pre(DECL_ARGS)
{