=================================================================== RCS file: /cvs/mandoc/mdoc_html.c,v retrieving revision 1.232 retrieving revision 1.235 diff -u -p -r1.232 -r1.235 --- mandoc/mdoc_html.c 2015/04/18 17:53:21 1.232 +++ mandoc/mdoc_html.c 2015/09/26 00:32:35 1.235 @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.232 2015/04/18 17:53:21 schwarze Exp $ */ +/* $Id: mdoc_html.c,v 1.235 2015/09/26 00:32:35 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2014, 2015 Ingo Schwarze @@ -641,18 +641,15 @@ mdoc_nm_pre(MDOC_ARGS) int len; switch (n->type) { + case ROFFT_HEAD: + print_otag(h, TAG_TD, 0, NULL); + /* FALLTHROUGH */ case ROFFT_ELEM: - synopsis_pre(h, n); PAIR_CLASS_INIT(&tag, "name"); print_otag(h, TAG_B, 1, &tag); - if (NULL == n->child && meta->name) + if (n->child == NULL && meta->name != NULL) print_text(h, meta->name); return(1); - case ROFFT_HEAD: - print_otag(h, TAG_TD, 0, NULL); - if (NULL == n->child && meta->name) - print_text(h, meta->name); - return(1); case ROFFT_BODY: print_otag(h, TAG_TD, 0, NULL); return(1); @@ -664,11 +661,11 @@ mdoc_nm_pre(MDOC_ARGS) PAIR_CLASS_INIT(&tag, "synopsis"); print_otag(h, TAG_TABLE, 1, &tag); - for (len = 0, n = n->child; n; n = n->next) + for (len = 0, n = n->head->child; n; n = n->next) if (n->type == ROFFT_TEXT) len += html_strlen(n->string); - if (0 == len && meta->name) + if (len == 0 && meta->name != NULL) len = html_strlen(meta->name); SCALE_HS_INIT(&su, len); @@ -1642,11 +1639,10 @@ mdoc_fo_pre(MDOC_ARGS) return(1); } - /* XXX: we drop non-initial arguments as per groff. */ + if (n->child == NULL) + return(0); - assert(n->child); assert(n->child->string); - PAIR_CLASS_INIT(&tag, "fname"); t = print_otag(h, TAG_B, 1, &tag); print_text(h, n->child->string);