summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/mdoc_html.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2010-09-27 21:25:28 +0000
committerschwarze <schwarze@openbsd.org>2010-09-27 21:25:28 +0000
commitd39b9a9c079e3622caebd814ddef8fbd4eea6eb8 (patch)
treeb4513262abc0a3b2a8910f0794bc98071bf2923b /usr.bin/mandoc/mdoc_html.c
parentUnbreak atalk: don't call ifa_add() until the ifa_addr pointer has been set (diff)
downloadwireguard-openbsd-d39b9a9c079e3622caebd814ddef8fbd4eea6eb8.tar.xz
wireguard-openbsd-d39b9a9c079e3622caebd814ddef8fbd4eea6eb8.zip
Merge the last bits of 1.10.6 (released today), most were already in:
* ignore double-.Pp * ignore .Pp before .Bd and .Bl (unless -compact in specified) * avoid double blank line upon .Pp, .br and friends in literal context * cast enums to int when passing them to exit(3) to please lint(1) While merging, fix a regression introduced by kristaps@: Outside literal mode, double blank lines must both be printed. To achieve this again after kristaps@ improvements in 1.10.6, treat such blank lines as .sp (instead of .Pp as in 1.10.5) and drop .Pp before .sp just like dropping .Pp before .Pp.
Diffstat (limited to 'usr.bin/mandoc/mdoc_html.c')
-rw-r--r--usr.bin/mandoc/mdoc_html.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/usr.bin/mandoc/mdoc_html.c b/usr.bin/mandoc/mdoc_html.c
index 09d28a03704..fb4cf6677bd 100644
--- a/usr.bin/mandoc/mdoc_html.c
+++ b/usr.bin/mandoc/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_html.c,v 1.32 2010/09/26 18:55:22 schwarze Exp $ */
+/* $Id: mdoc_html.c,v 1.33 2010/09/27 21:25:28 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -1312,6 +1312,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");