=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/man_html.c,v retrieving revision 1.116 retrieving revision 1.117 diff -c -r1.116 -r1.117 *** src/usr.bin/mandoc/man_html.c 2019/01/05 09:14:11 1.116 --- src/usr.bin/mandoc/man_html.c 2019/01/05 09:46:26 1.117 *************** *** 1,4 **** ! /* $OpenBSD: man_html.c,v 1.116 2019/01/05 09:14:11 schwarze Exp $ */ /* * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons * Copyright (c) 2013-2015, 2017-2019 Ingo Schwarze --- 1,4 ---- ! /* $OpenBSD: man_html.c,v 1.117 2019/01/05 09:46:26 schwarze Exp $ */ /* * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons * Copyright (c) 2013-2015, 2017-2019 Ingo Schwarze *************** *** 31,38 **** #include "html.h" #include "main.h" - /* FIXME: have PD set the default vspace width. */ - #define MAN_ARGS const struct roff_meta *man, \ const struct roff_node *n, \ struct html *h --- 31,36 ---- *************** *** 121,135 **** static void print_bvspace(struct html *h, const struct roff_node *n) { ! if (n->body && n->body->child) ! if (n->body->child->type == ROFFT_TBL) ! return; - if (n->parent->type == ROFFT_ROOT || n->parent->tok != MAN_RS) - if (NULL == n->prev) - return; - print_paragraph(h); } --- 119,131 ---- static void print_bvspace(struct html *h, const struct roff_node *n) { + if (n->body != NULL && n->body->child != NULL && + n->body->child->type == ROFFT_TBL) + return; ! if (n->prev == NULL && n->parent->tok != MAN_RS) ! return; print_paragraph(h); } *************** *** 177,183 **** static void print_man_nodelist(MAN_ARGS) { - while (n != NULL) { print_man_node(man, n, h); n = n->next; --- 173,178 ---- *************** *** 236,242 **** * the "meta" table state. This will be reopened on the * next table element. */ ! if (h->tblt) print_tblclose(h); t = h->tag; --- 231,237 ---- * the "meta" table state. This will be reopened on the * next table element. */ ! if (h->tblt != NULL) print_tblclose(h); t = h->tag; *************** *** 253,259 **** break; } ! if (child && n->child) print_man_nodelist(man, n->child, h); /* This will automatically close out any font scope. */ --- 248,254 ---- break; } ! if (child && n->child != NULL) print_man_nodelist(man, n->child, h); /* This will automatically close out any font scope. */ *************** *** 285,291 **** print_stagq(h, tt); print_otag(h, TAG_TD, "c", "head-vol"); ! if (NULL != man->vol) print_text(h, man->vol); print_stagq(h, tt); --- 280,286 ---- print_stagq(h, tt); print_otag(h, TAG_TD, "c", "head-vol"); ! if (man->vol != NULL) print_text(h, man->vol); print_stagq(h, tt); *************** *** 308,314 **** print_stagq(h, tt); print_otag(h, TAG_TD, "c", "foot-os"); ! if (man->os) print_text(h, man->os); print_tagq(h, t); } --- 303,309 ---- print_stagq(h, tt); print_otag(h, TAG_TD, "c", "foot-os"); ! if (man->os != NULL) print_text(h, man->os); print_tagq(h, t); } *************** *** 331,341 **** man_alt_pre(MAN_ARGS) { const struct roff_node *nn; int i; enum htmltag fp; - struct tag *t; ! for (i = 0, nn = n->child; nn; nn = nn->next, i++) { switch (n->tok) { case MAN_BI: fp = i % 2 ? TAG_I : TAG_B; --- 326,336 ---- man_alt_pre(MAN_ARGS) { const struct roff_node *nn; + struct tag *t; int i; enum htmltag fp; ! for (i = 0, nn = n->child; nn != NULL; nn = nn->next, i++) { switch (n->tok) { case MAN_BI: fp = i % 2 ? TAG_I : TAG_B; *************** *** 377,383 **** man_SM_pre(MAN_ARGS) { print_otag(h, TAG_SMALL, ""); ! if (MAN_SB == n->tok) print_otag(h, TAG_B, ""); return 1; } --- 372,378 ---- man_SM_pre(MAN_ARGS) { print_otag(h, TAG_SMALL, ""); ! if (n->tok == MAN_SB) print_otag(h, TAG_B, ""); return 1; } *************** *** 399,405 **** static int man_PP_pre(MAN_ARGS) { - if (n->type == ROFFT_HEAD) return 0; else if (n->type == ROFFT_BLOCK) --- 394,399 ---- *************** *** 441,447 **** default: abort(); } - return 0; } --- 435,440 ---- *************** *** 467,480 **** h->flags |= HTML_NOSPACE; tt = print_otag(h, TAG_SPAN, "c", "Op"); ! if (NULL != (n = n->child)) { print_otag(h, TAG_B, ""); print_text(h, n->string); } print_stagq(h, tt); ! if (NULL != n && NULL != n->next) { print_otag(h, TAG_I, ""); print_text(h, n->next->string); } --- 460,473 ---- h->flags |= HTML_NOSPACE; tt = print_otag(h, TAG_SPAN, "c", "Op"); ! if ((n = n->child) != NULL) { print_otag(h, TAG_B, ""); print_text(h, n->string); } print_stagq(h, tt); ! if (n != NULL && n->next != NULL) { print_otag(h, TAG_I, ""); print_text(h, n->next->string); } *************** *** 509,515 **** static int man_ign_pre(MAN_ARGS) { - return 0; } --- 502,507 ---- *************** *** 548,553 **** --- 540,546 ---- man_UR_pre(MAN_ARGS) { char *cp; + n = n->child; assert(n->type == ROFFT_HEAD); if (n->child != NULL) { *************** *** 565,571 **** n = n->next; print_man_nodelist(man, n->child, h); - return 0; } --- 558,563 ----