diff options
author | 2012-07-14 10:43:48 +0000 | |
---|---|---|
committer | 2012-07-14 10:43:48 +0000 | |
commit | c48ccfc39a0e78a37002984eede0915fff3f239f (patch) | |
tree | ce30ebeee2f3ac13a88cf5717bf75204bdf4eaf6 /usr.bin/mandoc | |
parent | In -Tman .Bl -compact, skip the blank line only before the first item (diff) | |
download | wireguard-openbsd-c48ccfc39a0e78a37002984eede0915fff3f239f.tar.xz wireguard-openbsd-c48ccfc39a0e78a37002984eede0915fff3f239f.zip |
Translate blank input lines to .sp just like in mdoc(7),
and ignore .sp after .PP. This fixes vertical spacing
for blank lines after .PP and for .sp after .PP.
Diffstat (limited to 'usr.bin/mandoc')
-rw-r--r-- | usr.bin/mandoc/man.c | 7 | ||||
-rw-r--r-- | usr.bin/mandoc/man_term.c | 19 |
2 files changed, 19 insertions, 7 deletions
diff --git a/usr.bin/mandoc/man.c b/usr.bin/mandoc/man.c index ea6d624a580..5bace1583da 100644 --- a/usr.bin/mandoc/man.c +++ b/usr.bin/mandoc/man.c @@ -1,4 +1,4 @@ -/* $Id: man.c,v 1.67 2012/07/07 18:27:36 schwarze Exp $ */ +/* $Id: man.c,v 1.68 2012/07/14 10:43:48 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -431,9 +431,10 @@ man_ptext(struct man *m, int line, char *buf, int offs) if ('\0' == buf[i]) { /* Allocate a blank entry. */ - if ( ! man_word_alloc(m, line, offs, "")) + if ( ! man_elem_alloc(m, line, offs, MAN_sp)) return(0); - return(man_descope(m, line, offs)); + m->next = MAN_NEXT_SIBLING; + return(1); } /* diff --git a/usr.bin/mandoc/man_term.c b/usr.bin/mandoc/man_term.c index b14ca7726d3..1be65baa9e5 100644 --- a/usr.bin/mandoc/man_term.c +++ b/usr.bin/mandoc/man_term.c @@ -1,4 +1,4 @@ -/* $Id: man_term.c,v 1.85 2012/07/13 14:15:50 schwarze Exp $ */ +/* $Id: man_term.c,v 1.86 2012/07/14 10:43:48 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010, 2011, 2012 Ingo Schwarze <schwarze@openbsd.org> @@ -441,10 +441,21 @@ pre_sp(DECL_ARGS) int neg; if ((NULL == n->prev && n->parent)) { - if (MAN_SS == n->parent->tok) - return(0); - if (MAN_SH == n->parent->tok) + switch (n->parent->tok) { + case (MAN_SH): + /* FALLTHROUGH */ + case (MAN_SS): + /* FALLTHROUGH */ + case (MAN_PP): + /* FALLTHROUGH */ + case (MAN_LP): + /* FALLTHROUGH */ + case (MAN_P): + /* FALLTHROUGH */ return(0); + default: + break; + } } neg = 0; |