=================================================================== RCS file: /cvs/mandoc/man_html.c,v retrieving revision 1.123 retrieving revision 1.128 diff -u -p -r1.123 -r1.128 --- mandoc/man_html.c 2017/01/17 15:32:44 1.123 +++ mandoc/man_html.c 2017/01/20 23:51:00 1.128 @@ -1,4 +1,4 @@ -/* $Id: man_html.c,v 1.123 2017/01/17 15:32:44 schwarze Exp $ */ +/* $Id: man_html.c,v 1.128 2017/01/20 23:51:00 schwarze Exp $ */ /* * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons * Copyright (c) 2013, 2014, 2015, 2017 Ingo Schwarze @@ -148,25 +148,26 @@ html_man(void *arg, const struct roff_man *man) { struct mhtml mh; struct html *h; - struct tag *t, *tt; + struct tag *t; memset(&mh, 0, sizeof(mh)); h = (struct html *)arg; - if ( ! (HTML_FRAGMENT & h->oflags)) { + if ((h->oflags & HTML_FRAGMENT) == 0) { print_gen_decls(h); - t = print_otag(h, TAG_HTML, ""); - tt = print_otag(h, TAG_HEAD, ""); + print_otag(h, TAG_HTML, ""); + t = print_otag(h, TAG_HEAD, ""); print_man_head(&man->meta, man->first, &mh, h); - print_tagq(h, tt); + print_tagq(h, t); print_otag(h, TAG_BODY, ""); - print_otag(h, TAG_DIV, "c", "mandoc"); - } else - t = print_otag(h, TAG_DIV, "c", "mandoc"); + } - print_man_nodelist(&man->meta, man->first, &mh, h); + man_root_pre(&man->meta, man->first, &mh, h); + t = print_otag(h, TAG_DIV, "c", "manual-text"); + print_man_nodelist(&man->meta, man->first->child, &mh, h); print_tagq(h, t); - putchar('\n'); + man_root_post(&man->meta, man->first, &mh, h); + print_tagq(h, NULL); } static void @@ -201,9 +202,6 @@ print_man_node(MAN_ARGS) t = h->tags.head; switch (n->type) { - case ROFFT_ROOT: - man_root_pre(man, n, mh, h); - break; case ROFFT_TEXT: if ('\0' == *n->string) { print_paragraph(h); @@ -216,8 +214,6 @@ print_man_node(MAN_ARGS) print_text(h, n->string); return; case ROFFT_EQN: - if (n->flags & NODE_LINE) - putchar('\n'); print_eqn(h, n->eqn); break; case ROFFT_TBL: @@ -259,9 +255,6 @@ print_man_node(MAN_ARGS) print_stagq(h, t); switch (n->type) { - case ROFFT_ROOT: - man_root_post(man, n, mh, h); - break; case ROFFT_EQN: break; default: @@ -358,12 +351,11 @@ man_SH_pre(MAN_ARGS) { if (n->type == ROFFT_BLOCK) { mh->fl &= ~MANH_LITERAL; - print_otag(h, TAG_DIV, "c", "section"); return 1; } else if (n->type == ROFFT_BODY) return 1; - print_otag(h, TAG_H1, ""); + print_otag(h, TAG_H1, "c", "Sh"); return 1; } @@ -437,12 +429,11 @@ man_SS_pre(MAN_ARGS) { if (n->type == ROFFT_BLOCK) { mh->fl &= ~MANH_LITERAL; - print_otag(h, TAG_DIV, "c", "subsection"); return 1; } else if (n->type == ROFFT_BODY) return 1; - print_otag(h, TAG_H2, ""); + print_otag(h, TAG_H2, "c", "Ss"); return 1; } @@ -515,7 +506,7 @@ man_HP_pre(MAN_ARGS) sui.scale = -sum.scale; print_bvspace(h, n); - print_otag(h, TAG_DIV, "csului", "spacer", &sum, &sui); + print_otag(h, TAG_DIV, "csului", "Pp", &sum, &sui); return 1; } @@ -526,7 +517,7 @@ man_OP_pre(MAN_ARGS) print_text(h, "["); h->flags |= HTML_NOSPACE; - tt = print_otag(h, TAG_SPAN, "c", "opt"); + tt = print_otag(h, TAG_SPAN, "c", "Op"); if (NULL != (n = n->child)) { print_otag(h, TAG_B, ""); @@ -612,7 +603,7 @@ man_UR_pre(MAN_ARGS) assert(n->type == ROFFT_HEAD); if (n->child != NULL) { assert(n->child->type == ROFFT_TEXT); - print_otag(h, TAG_A, "ch", "link-ext", n->child->string); + print_otag(h, TAG_A, "ch", "Lk", n->child->string); } assert(n->next->type == ROFFT_BODY);