=================================================================== RCS file: /cvs/mandoc/mdoc_html.c,v retrieving revision 1.263 retrieving revision 1.268 diff -u -p -r1.263 -r1.268 --- mandoc/mdoc_html.c 2017/01/28 22:36:38 1.263 +++ mandoc/mdoc_html.c 2017/02/05 20:34:57 1.268 @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.263 2017/01/28 22:36:38 schwarze Exp $ */ +/* $Id: mdoc_html.c,v 1.268 2017/02/05 20:34:57 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze @@ -349,7 +349,7 @@ print_mdoc_node(MDOC_ARGS) return; child = 1; - t = h->tags.head; + t = h->tag; n->flags &= ~NODE_ENDED; switch (n->type) { @@ -389,7 +389,7 @@ print_mdoc_node(MDOC_ARGS) */ if (h->tblt != NULL) { print_tblclose(h); - t = h->tags.head; + t = h->tag; } assert(h->tblt == NULL); if (mdocs[n->tok].pre && (n->end == ENDBODY_NOT || n->child)) @@ -428,7 +428,6 @@ mdoc_root_post(MDOC_ARGS) struct tag *t, *tt; t = print_otag(h, TAG_TABLE, "c", "foot"); - print_otag(h, TAG_TBODY, ""); tt = print_otag(h, TAG_TR, ""); print_otag(h, TAG_TD, "c", "foot-date"); @@ -459,7 +458,6 @@ mdoc_root_pre(MDOC_ARGS) meta->title, meta->msec); t = print_otag(h, TAG_TABLE, "c", "head"); - print_otag(h, TAG_TBODY, ""); tt = print_otag(h, TAG_TR, ""); print_otag(h, TAG_TD, "c", "head-ltitle"); @@ -574,6 +572,7 @@ mdoc_nd_pre(MDOC_ARGS) static int mdoc_nm_pre(MDOC_ARGS) { + struct tag *t; int len; switch (n->type) { @@ -602,9 +601,10 @@ mdoc_nm_pre(MDOC_ARGS) if (len == 0 && meta->name != NULL) len = html_strlen(meta->name); + t = print_otag(h, TAG_COLGROUP, ""); print_otag(h, TAG_COL, "shw", len); print_otag(h, TAG_COL, ""); - print_otag(h, TAG_TBODY, ""); + print_tagq(h, t); print_otag(h, TAG_TR, ""); return 1; } @@ -649,7 +649,7 @@ mdoc_ns_pre(MDOC_ARGS) static int mdoc_ar_pre(MDOC_ARGS) { - print_otag(h, TAG_I, "c", "Ar"); + print_otag(h, TAG_VAR, "c", "Ar"); return 1; } @@ -801,6 +801,7 @@ mdoc_it_pre(MDOC_ARGS) static int mdoc_bl_pre(MDOC_ARGS) { + struct tag *t; struct mdoc_bl *bl; const char *cattr; size_t i; @@ -808,13 +809,11 @@ mdoc_bl_pre(MDOC_ARGS) bl = &n->norm->Bl; - if (n->type == ROFFT_BODY) { - if (bl->type == LIST_column) - print_otag(h, TAG_TBODY, ""); + switch (n->type) { + case ROFFT_BODY: return 1; - } - if (n->type == ROFFT_HEAD) { + case ROFFT_HEAD: if (bl->type != LIST_column || bl->ncols == 0) return 0; @@ -825,10 +824,15 @@ mdoc_bl_pre(MDOC_ARGS) * screen and we want to preserve that behaviour. */ + t = print_otag(h, TAG_COLGROUP, ""); for (i = 0; i < bl->ncols - 1; i++) print_otag(h, TAG_COL, "sww", bl->cols[i]); print_otag(h, TAG_COL, "swW", bl->cols[i]); + print_tagq(h, t); return 0; + + default: + break; } switch (bl->type) { @@ -1084,12 +1088,12 @@ mdoc_fa_pre(MDOC_ARGS) struct tag *t; if (n->parent->tok != MDOC_Fo) { - print_otag(h, TAG_I, "c", "Fa"); + print_otag(h, TAG_VAR, "c", "Fa"); return 1; } for (nn = n->child; nn; nn = nn->next) { - t = print_otag(h, TAG_I, "c", "Fa"); + t = print_otag(h, TAG_VAR, "c", "Fa"); print_text(h, nn->string); print_tagq(h, t); if (nn->next) { @@ -1168,7 +1172,7 @@ mdoc_vt_pre(MDOC_ARGS) } else if (n->type == ROFFT_HEAD) return 0; - print_otag(h, TAG_I, "c", "Vt"); + print_otag(h, TAG_VAR, "c", "Vt"); return 1; } @@ -1176,7 +1180,7 @@ static int mdoc_ft_pre(MDOC_ARGS) { synopsis_pre(h, n); - print_otag(h, TAG_I, "c", "Ft"); + print_otag(h, TAG_VAR, "c", "Ft"); return 1; } @@ -1197,7 +1201,7 @@ mdoc_fn_pre(MDOC_ARGS) ep = strchr(sp, ' '); if (NULL != ep) { - t = print_otag(h, TAG_I, "c", "Ft"); + t = print_otag(h, TAG_VAR, "c", "Ft"); while (ep) { sz = MIN((int)(ep - sp), BUFSIZ - 1); @@ -1223,10 +1227,10 @@ mdoc_fn_pre(MDOC_ARGS) for (n = n->child->next; n; n = n->next) { if (NODE_SYNPRETTY & n->flags) - t = print_otag(h, TAG_I, "css?", "Fa", + t = print_otag(h, TAG_VAR, "css?", "Fa", "white-space", "nowrap"); else - t = print_otag(h, TAG_I, "c", "Fa"); + t = print_otag(h, TAG_VAR, "c", "Fa"); print_text(h, n->string); print_tagq(h, t); if (n->next) { @@ -1434,7 +1438,7 @@ mdoc_ic_pre(MDOC_ARGS) static int mdoc_va_pre(MDOC_ARGS) { - print_otag(h, TAG_I, "c", "Va"); + print_otag(h, TAG_VAR, "c", "Va"); return 1; } @@ -1465,7 +1469,7 @@ mdoc_bf_pre(MDOC_ARGS) else if (FONT_Li == n->norm->Bf.font) cattr = "Li"; else - cattr = "none"; + cattr = "No"; /* * We want this to be inline-formatted, but needs to be div to @@ -1508,7 +1512,7 @@ mdoc_rs_pre(MDOC_ARGS) if (n->prev && SEC_SEE_ALSO == n->sec) print_paragraph(h); - print_otag(h, TAG_SPAN, "c", "Rs"); + print_otag(h, TAG_CITE, "c", "Rs"); return 1; }