diff options
-rw-r--r-- | TODO | 5 | ||||
-rw-r--r-- | mdoc.7 | 5 | ||||
-rw-r--r-- | mdoc_html.c | 22 | ||||
-rw-r--r-- | mdoc_term.c | 22 |
4 files changed, 46 insertions, 8 deletions
@@ -1,6 +1,6 @@ ************************************************************************ * Official mandoc TODO. -* $Id: TODO,v 1.54 2010/09/27 10:47:48 kristaps Exp $ +* $Id: TODO,v 1.55 2010/09/27 11:21:39 kristaps Exp $ ************************************************************************ ************************************************************************ @@ -134,9 +134,6 @@ In -unfilled, tabs are 5 spaces, just like in -filled and -ragged. See the CCDF_* display in OpenBSD ccdconfig(8). -- In .Bd -unfilled, .Pp should produce one blank line, not two; - see the ccd.conf display in OpenBSD ccdconfig(8). - - .Nx 1.0a should be "NetBSD 1.0A", not "NetBSD 1.0a", see OpenBSD ccdconfig(8). @@ -1,4 +1,4 @@ -.\" $Id: mdoc.7,v 1.160 2010/09/27 06:56:44 kristaps Exp $ +.\" $Id: mdoc.7,v 1.161 2010/09/27 11:21:39 kristaps Exp $ .\" .\" Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> .\" Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org> @@ -1076,7 +1076,8 @@ implementations render it poorly. Left- and right-justify the block. .It Fl literal Do not justify the block at all. -Preserve white space as it appears in the input. +Preserve white space and newlines as they appear in the input, including +if it follows a macro. .It Fl ragged Only left-justify the block. .It Fl unfilled diff --git a/mdoc_html.c b/mdoc_html.c index 08f34133..a621936a 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.107 2010/09/26 10:32:14 kristaps Exp $ */ +/* $Id: mdoc_html.c,v 1.108 2010/09/27 11:21:39 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -1316,6 +1316,26 @@ mdoc_bd_pre(MDOC_ARGS) for (nn = n->child; nn; nn = nn->next) { print_mdoc_node(m, nn, h); + /* + * If the printed node flushes its own line, then we + * needn't do it here as well. This is hacky, but the + * notion of selective eoln whitespace is pretty dumb + * anyway, so don't sweat it. + */ + switch (nn->tok) { + case (MDOC_br): + /* FALLTHROUGH */ + case (MDOC_sp): + /* FALLTHROUGH */ + case (MDOC_Bl): + /* FALLTHROUGH */ + case (MDOC_Lp): + /* FALLTHROUGH */ + case (MDOC_Pp): + continue; + default: + break; + } if (nn->next && nn->next->line == nn->line) continue; print_text(h, "\n"); diff --git a/mdoc_term.c b/mdoc_term.c index 5df90460..d57eacd9 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.189 2010/09/26 10:00:42 kristaps Exp $ */ +/* $Id: mdoc_term.c,v 1.190 2010/09/27 11:21:39 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org> @@ -1578,6 +1578,26 @@ termp_bd_pre(DECL_ARGS) for (nn = n->child; nn; nn = nn->next) { print_mdoc_node(p, pair, m, nn); + /* + * If the printed node flushes its own line, then we + * needn't do it here as well. This is hacky, but the + * notion of selective eoln whitespace is pretty dumb + * anyway, so don't sweat it. + */ + switch (nn->tok) { + case (MDOC_br): + /* FALLTHROUGH */ + case (MDOC_sp): + /* FALLTHROUGH */ + case (MDOC_Bl): + /* FALLTHROUGH */ + case (MDOC_Lp): + /* FALLTHROUGH */ + case (MDOC_Pp): + continue; + default: + break; + } if (nn->next && nn->next->line == nn->line) continue; term_flushln(p); |