summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/man_html.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2011-01-16 02:56:47 +0000
committerschwarze <schwarze@openbsd.org>2011-01-16 02:56:47 +0000
commitaad3ea0cf9a80eeddbd69941824fa913eaa077f5 (patch)
tree805a454b0d7cefde822d4d059eaa9e85d2a227e3 /usr.bin/mandoc/man_html.c
parentVarious tbl improvements from kristaps@: (diff)
downloadwireguard-openbsd-aad3ea0cf9a80eeddbd69941824fa913eaa077f5.tar.xz
wireguard-openbsd-aad3ea0cf9a80eeddbd69941824fa913eaa077f5.zip
If the first character of a free-form text input line is whitespace,
then it will start a new output line; from kristaps@.
Diffstat (limited to 'usr.bin/mandoc/man_html.c')
-rw-r--r--usr.bin/mandoc/man_html.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.bin/mandoc/man_html.c b/usr.bin/mandoc/man_html.c
index 042a1ef1cd0..78d2da75f6e 100644
--- a/usr.bin/mandoc/man_html.c
+++ b/usr.bin/mandoc/man_html.c
@@ -1,4 +1,4 @@
-/* $Id: man_html.c,v 1.30 2011/01/09 16:31:45 schwarze Exp $ */
+/* $Id: man_html.c,v 1.31 2011/01/16 02:56:47 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -193,7 +193,16 @@ print_man_node(MAN_ARGS)
child = man_root_pre(m, n, mh, h);
break;
case (MAN_TEXT):
+ if ('\0' == *n->string) {
+ print_otag(h, TAG_P, 0, NULL);
+ return;
+ }
+
+ if (' ' == *n->string && MAN_LINE & n->flags)
+ print_otag(h, TAG_BR, 0, NULL);
+
print_text(h, n->string);
+
if (MANH_LITERAL & mh->fl)
print_otag(h, TAG_BR, 0, NULL);
return;