=================================================================== RCS file: /cvs/mandoc/mdoc_html.c,v retrieving revision 1.43 retrieving revision 1.49 diff -u -p -r1.43 -r1.49 --- mandoc/mdoc_html.c 2009/10/30 18:53:08 1.43 +++ mandoc/mdoc_html.c 2009/12/02 10:16:55 1.49 @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.43 2009/10/30 18:53:08 kristaps Exp $ */ +/* $Id: mdoc_html.c,v 1.49 2009/12/02 10:16:55 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -424,7 +424,7 @@ print_mdoc_node(MDOC_ARGS) break; case (MDOC_TEXT): print_text(h, n->string); - break; + return; default: if (mdocs[n->tok].pre) child = (*mdocs[n->tok].pre)(m, n, h); @@ -441,8 +441,6 @@ print_mdoc_node(MDOC_ARGS) case (MDOC_ROOT): mdoc_root_post(m, n, h); break; - case (MDOC_TEXT): - break; default: if (mdocs[n->tok].post) (*mdocs[n->tok].post)(m, n, h); @@ -725,12 +723,11 @@ mdoc_nm_pre(MDOC_ARGS) { struct htmlpair tag; - if ( ! (HTML_NEWLINE & h->flags)) - if (SEC_SYNOPSIS == n->sec) { - bufcat_style(h, "clear", "both"); - PAIR_STYLE_INIT(&tag, h); - print_otag(h, TAG_BR, 1, &tag); - } + if (SEC_SYNOPSIS == n->sec && n->prev) { + bufcat_style(h, "clear", "both"); + PAIR_STYLE_INIT(&tag, h); + print_otag(h, TAG_BR, 1, &tag); + } PAIR_CLASS_INIT(&tag, "name"); print_otag(h, TAG_SPAN, 1, &tag); @@ -810,7 +807,7 @@ mdoc_xx_pre(MDOC_ARGS) pp = "BSDI BSD/OS"; break; case (MDOC_Dx): - pp = "DragonFlyBSD"; + pp = "DragonFly"; break; case (MDOC_Fx): pp = "FreeBSD"; @@ -951,9 +948,10 @@ mdoc_it_head_pre(MDOC_ARGS, int type, struct roffsu *w switch (type) { case (MDOC_Item): - /* FALLTHROUGH */ - case (MDOC_Ohang): return(0); + case (MDOC_Ohang): + print_otag(h, TAG_DIV, 0, &tag); + return(1); case (MDOC_Column): bufcat_su(h, "min-width", width); bufcat_style(h, "clear", "none"); @@ -1067,6 +1065,8 @@ mdoc_it_pre(MDOC_ARGS) /* Override width in some cases. */ switch (type) { + case (MDOC_Ohang): + /* FALLTHROUGH */ case (MDOC_Item): /* FALLTHROUGH */ case (MDOC_Inset): @@ -1115,7 +1115,7 @@ mdoc_bl_pre(MDOC_ARGS) ord = malloc(sizeof(struct ord)); if (NULL == ord) { - fprintf(stderr, "memory exhausted\n"); + perror(NULL); exit(EXIT_FAILURE); } ord->cookie = n; @@ -1573,9 +1573,9 @@ mdoc_vt_pre(MDOC_ARGS) struct roffsu su; if (SEC_SYNOPSIS == n->sec) { - if (n->next && MDOC_Vt != n->next->tok) { + if (n->prev && MDOC_Vt != n->prev->tok) { SCALE_VS_INIT(&su, 1); - bufcat_su(h, "margin-bottom", &su); + bufcat_su(h, "margin-top", &su); PAIR_STYLE_INIT(&tag, h); print_otag(h, TAG_DIV, 1, &tag); } else