=================================================================== RCS file: /cvs/mandoc/mdoc_html.c,v retrieving revision 1.99 retrieving revision 1.103 diff -u -p -r1.99 -r1.103 --- mandoc/mdoc_html.c 2010/07/23 00:08:57 1.99 +++ mandoc/mdoc_html.c 2010/09/04 19:01:52 1.103 @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.99 2010/07/23 00:08:57 kristaps Exp $ */ +/* $Id: mdoc_html.c,v 1.103 2010/09/04 19:01:52 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * @@ -1183,7 +1183,7 @@ mdoc_bl_pre(MDOC_ARGS) ord = malloc(sizeof(struct ord)); if (NULL == ord) { perror(NULL); - exit(EXIT_FAILURE); + exit(MANDOCLEVEL_SYSERR); } ord->cookie = n; ord->pos = 1; @@ -1457,14 +1457,11 @@ mdoc_bd_pre(MDOC_ARGS) print_otag(h, TAG_DIV, 2, tag); for (nn = n->child; nn; nn = nn->next) { - h->flags |= HTML_NOSPACE; print_mdoc_node(m, nn, h); - if (NULL == nn->next) + if (nn->next && nn->next->line == nn->line) continue; - if (nn->prev && nn->prev->line < nn->line) - print_text(h, "\n"); - else if (NULL == nn->prev) - print_text(h, "\n"); + print_text(h, "\n"); + h->flags |= HTML_NOSPACE; } return(0); @@ -2197,6 +2194,9 @@ mdoc__x_pre(MDOC_ARGS) switch (n->tok) { case(MDOC__A): PAIR_CLASS_INIT(&tag[0], "ref-auth"); + if (n->prev && MDOC__A == n->prev->tok) + if (NULL == n->next || MDOC__A != n->next->tok) + print_text(h, "and"); break; case(MDOC__B): PAIR_CLASS_INIT(&tag[0], "ref-book"); @@ -2249,6 +2249,7 @@ mdoc__x_pre(MDOC_ARGS) PAIR_HREF_INIT(&tag[1], n->child->string); print_otag(h, TAG_A, 2, tag); + return(1); } @@ -2257,6 +2258,11 @@ mdoc__x_pre(MDOC_ARGS) static void mdoc__x_post(MDOC_ARGS) { + + if (MDOC__A == n->tok && n->next && MDOC__A == n->next->tok) + if (NULL == n->next->next || MDOC__A != n->next->next->tok) + if (NULL == n->prev || MDOC__A != n->prev->tok) + return; /* TODO: %U */