=================================================================== RCS file: /cvs/mandoc/mdoc_html.c,v retrieving revision 1.173 retrieving revision 1.175 diff -u -p -r1.173 -r1.175 --- mandoc/mdoc_html.c 2011/07/21 11:34:53 1.173 +++ mandoc/mdoc_html.c 2011/08/10 14:07:23 1.175 @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.173 2011/07/21 11:34:53 kristaps Exp $ */ +/* $Id: mdoc_html.c,v 1.175 2011/08/10 14:07:23 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * @@ -407,7 +407,6 @@ print_mdoc_node(MDOC_ARGS) { int child; struct tag *t; - struct htmlpair tag; child = 1; t = h->tags.head; @@ -434,9 +433,7 @@ print_mdoc_node(MDOC_ARGS) h->flags |= HTML_NOSPACE; return; case (MDOC_EQN): - PAIR_CLASS_INIT(&tag, "eqn"); - /*print_otag(h, TAG_SPAN, 1, &tag); - print_text(h, n->eqn->data);*/ + print_eqn(h, n->eqn); break; case (MDOC_TBL): /* @@ -611,18 +608,22 @@ mdoc_sh_pre(MDOC_ARGS) bufinit(h); bufcat(h, "x"); - for (n = n->child; n; n = n->next) { + + for (n = n->child; n && MDOC_TEXT == n->type; ) { bufcat_id(h, n->string); - if (n->next) + if (NULL != (n = n->next)) bufcat_id(h, " "); } - PAIR_ID_INIT(&tag, h->buf); - print_otag(h, TAG_H1, 1, &tag); + if (NULL == n) { + PAIR_ID_INIT(&tag, h->buf); + print_otag(h, TAG_H1, 1, &tag); + } else + print_otag(h, TAG_H1, 0, NULL); + return(1); } - /* ARGSUSED */ static int mdoc_ss_pre(MDOC_ARGS) @@ -638,14 +639,19 @@ mdoc_ss_pre(MDOC_ARGS) bufinit(h); bufcat(h, "x"); - for (n = n->child; n; n = n->next) { + + for (n = n->child; n && MDOC_TEXT == n->type; ) { bufcat_id(h, n->string); - if (n->next) + if (NULL != (n = n->next)) bufcat_id(h, " "); } - PAIR_ID_INIT(&tag, h->buf); - print_otag(h, TAG_H2, 1, &tag); + if (NULL == n) { + PAIR_ID_INIT(&tag, h->buf); + print_otag(h, TAG_H2, 1, &tag); + } else + print_otag(h, TAG_H2, 0, NULL); + return(1); } @@ -1174,9 +1180,10 @@ mdoc_sx_pre(MDOC_ARGS) bufinit(h); bufcat(h, "#x"); - for (n = n->child; n; n = n->next) { + + for (n = n->child; n; ) { bufcat_id(h, n->string); - if (n->next) + if (NULL != (n = n->next)) bufcat_id(h, " "); }