summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/man_html.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/mandoc/man_html.c')
-rw-r--r--usr.bin/mandoc/man_html.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/usr.bin/mandoc/man_html.c b/usr.bin/mandoc/man_html.c
index b5b11914b0a..7da9a5a40d5 100644
--- a/usr.bin/mandoc/man_html.c
+++ b/usr.bin/mandoc/man_html.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: man_html.c,v 1.119 2019/01/06 04:41:15 schwarze Exp $ */
+/* $OpenBSD: man_html.c,v 1.120 2019/01/07 06:51:37 schwarze Exp $ */
/*
* Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013-2015, 2017-2019 Ingo Schwarze <schwarze@openbsd.org>
@@ -160,16 +160,22 @@ print_man_node(MAN_ARGS)
struct tag *t;
int child;
+ if (n->type == ROFFT_COMMENT || n->flags & NODE_NOPRT)
+ return;
+
html_fillmode(h, n->flags & NODE_NOFILL ? ROFF_nf : ROFF_fi);
child = 1;
+ t = h->tag;
+ if (t->tag == TAG_P || t->tag == TAG_PRE)
+ t = t->next;
+
switch (n->type) {
case ROFFT_TEXT:
if (*n->string == '\0') {
print_endline(h);
return;
}
- t = h->tag;
if (*n->string == ' ' && n->flags & NODE_LINE &&
(h->flags & HTML_NONEWLINE) == 0)
print_endline(h);
@@ -177,10 +183,7 @@ print_man_node(MAN_ARGS)
h->flags |= HTML_NOSPACE;
print_text(h, n->string);
break;
- case ROFFT_COMMENT:
- return;
case ROFFT_EQN:
- t = h->tag;
print_eqn(h, n->eqn);
break;
case ROFFT_TBL:
@@ -206,17 +209,15 @@ print_man_node(MAN_ARGS)
* the "meta" table state. This will be reopened on the
* next table element.
*/
- if (h->tblt != NULL)
+ if (h->tblt != NULL) {
print_tblclose(h);
-
- t = h->tag;
+ t = h->tag;
+ }
if (n->tok < ROFF_MAX) {
roff_html_pre(h, n);
- if (n->tok != ROFF_sp)
- print_stagq(h, t);
+ print_stagq(h, t);
return;
}
-
assert(n->tok >= MAN_TH && n->tok < MAN_MAX);
if (man_html_acts[n->tok - MAN_TH].pre != NULL)
child = (*man_html_acts[n->tok - MAN_TH].pre)(man,