aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_man.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2012-07-07 13:37:42 +0000
committerIngo Schwarze <schwarze@openbsd.org>2012-07-07 13:37:42 +0000
commitbfaa5b4fbefce84457c5f60ff55d00f937c91272 (patch)
tree25bafcb2442c822995b5ac800b5e4fbe29f75a2f /mdoc_man.c
parent159e0889bfdc6b2aa2db67a90779ff347c306759 (diff)
downloadmandoc-bfaa5b4fbefce84457c5f60ff55d00f937c91272.tar.gz
mandoc-bfaa5b4fbefce84457c5f60ff55d00f937c91272.tar.zst
mandoc-bfaa5b4fbefce84457c5f60ff55d00f937c91272.zip
minor -mdoc -Tman fixes
* right after .Ns, avoid breaking the line in man code * after .Fl without arguments, do not insert a blank into man code * before each .Nm in .Sh SYNOPSIS, insert a .br into man code * skip .Pp arguments, don't copy them to man code OpenBSD rev. 1.7
Diffstat (limited to 'mdoc_man.c')
-rw-r--r--mdoc_man.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/mdoc_man.c b/mdoc_man.c
index 9d7d2ca2..3c56e300 100644
--- a/mdoc_man.c
+++ b/mdoc_man.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_man.c,v 1.9 2011/10/24 21:47:59 schwarze Exp $ */
+/* $Id: mdoc_man.c,v 1.10 2012/07/07 13:37:42 schwarze Exp $ */
/*
* Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org>
*
@@ -290,7 +290,7 @@ print_node(DECL_ARGS)
* This makes the page structure be more consistent.
*/
prev = n->prev ? n->prev : n->parent;
- if (prev && prev->line < n->line)
+ if (prev && prev->line < n->line && MDOC_Ns != prev->tok)
mm->need_nl = 1;
act = NULL;
@@ -379,6 +379,8 @@ post_enc(DECL_ARGS)
return;
mm->need_space = 0;
print_word(mm, suffix);
+ if (MDOC_Fl == n->tok && 0 == n->nchild)
+ mm->need_space = 0;
}
/*
@@ -544,6 +546,11 @@ pre_nm(DECL_ARGS)
if (MDOC_ELEM != n->type && MDOC_HEAD != n->type)
return(1);
+ if (MDOC_SYNPRETTY & n->flags) {
+ mm->need_nl = 1;
+ print_word(mm, ".br");
+ mm->need_nl = 1;
+ }
print_word(mm, "\\fB");
mm->need_space = 0;
if (NULL == n->child)
@@ -586,7 +593,7 @@ pre_pp(DECL_ARGS)
else
print_word(mm, ".PP");
mm->need_nl = 1;
- return(1);
+ return(MDOC_Rs == n->tok);
}
static int