From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from krisdoz.my.domain (kristaps@localhost [127.0.0.1]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id o8RBLf6b027911 for ; Mon, 27 Sep 2010 07:21:41 -0400 (EDT) Received: (from kristaps@localhost) by krisdoz.my.domain (8.14.3/8.14.3/Submit) id o8RBLd3k008303; Mon, 27 Sep 2010 07:21:39 -0400 (EDT) Date: Mon, 27 Sep 2010 07:21:39 -0400 (EDT) Message-Id: <201009271121.o8RBLd3k008303@krisdoz.my.domain> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: kristaps@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: Suppress whitespace following Pp, Lp, sp, and the other X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- Suppress whitespace following Pp, Lp, sp, and the other newline-emitting macros within an unfilled or literal `Bd'. Modified Files: -------------- mdocml: TODO mdoc.7 mdoc_html.c mdoc_term.c Revision Data ------------- Index: TODO =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/TODO,v retrieving revision 1.54 retrieving revision 1.55 diff -LTODO -LTODO -u -p -r1.54 -r1.55 --- TODO +++ TODO @@ -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). Index: mdoc_html.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_html.c,v retrieving revision 1.107 retrieving revision 1.108 diff -Lmdoc_html.c -Lmdoc_html.c -u -p -r1.107 -r1.108 --- mdoc_html.c +++ mdoc_html.c @@ -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"); Index: mdoc_term.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_term.c,v retrieving revision 1.189 retrieving revision 1.190 diff -Lmdoc_term.c -Lmdoc_term.c -u -p -r1.189 -r1.190 --- mdoc_term.c +++ mdoc_term.c @@ -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); Index: mdoc.7 =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc.7,v retrieving revision 1.160 retrieving revision 1.161 diff -Lmdoc.7 -Lmdoc.7 -u -p -r1.160 -r1.161 --- mdoc.7 +++ mdoc.7 @@ -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 -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv