=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mdoc_html.c,v retrieving revision 1.70 retrieving revision 1.71 diff -c -r1.70 -r1.71 *** src/usr.bin/mandoc/mdoc_html.c 2014/03/30 19:47:32 1.70 --- src/usr.bin/mandoc/mdoc_html.c 2014/04/20 16:44:44 1.71 *************** *** 1,4 **** ! /* $Id: mdoc_html.c,v 1.70 2014/03/30 19:47:32 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2014 Ingo Schwarze --- 1,4 ---- ! /* $Id: mdoc_html.c,v 1.71 2014/04/20 16:44:44 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2014 Ingo Schwarze *************** *** 49,55 **** static void print_mdoc_head(MDOC_ARGS); static void print_mdoc_node(MDOC_ARGS); static void print_mdoc_nodelist(MDOC_ARGS); ! static void synopsis_pre(struct html *, const struct mdoc_node *); static void a2width(const char *, struct roffsu *); --- 49,55 ---- static void print_mdoc_head(MDOC_ARGS); static void print_mdoc_node(MDOC_ARGS); static void print_mdoc_nodelist(MDOC_ARGS); ! static void synopsis_pre(struct html *, const struct mdoc_node *); static void a2width(const char *, struct roffsu *); *************** *** 123,130 **** {NULL, NULL}, /* Dt */ {NULL, NULL}, /* Os */ {mdoc_sh_pre, NULL }, /* Sh */ ! {mdoc_ss_pre, NULL }, /* Ss */ ! {mdoc_pp_pre, NULL}, /* Pp */ {mdoc_d1_pre, NULL}, /* D1 */ {mdoc_d1_pre, NULL}, /* Dl */ {mdoc_bd_pre, NULL}, /* Bd */ --- 123,130 ---- {NULL, NULL}, /* Dt */ {NULL, NULL}, /* Os */ {mdoc_sh_pre, NULL }, /* Sh */ ! {mdoc_ss_pre, NULL }, /* Ss */ ! {mdoc_pp_pre, NULL}, /* Pp */ {mdoc_d1_pre, NULL}, /* D1 */ {mdoc_d1_pre, NULL}, /* Dl */ {mdoc_bd_pre, NULL}, /* Bd */ *************** *** 132,163 **** {mdoc_bl_pre, NULL}, /* Bl */ {NULL, NULL}, /* El */ {mdoc_it_pre, NULL}, /* It */ ! {mdoc_ad_pre, NULL}, /* Ad */ {mdoc_an_pre, NULL}, /* An */ {mdoc_ar_pre, NULL}, /* Ar */ {mdoc_cd_pre, NULL}, /* Cd */ {mdoc_fl_pre, NULL}, /* Cm */ ! {mdoc_dv_pre, NULL}, /* Dv */ ! {mdoc_er_pre, NULL}, /* Er */ ! {mdoc_ev_pre, NULL}, /* Ev */ {mdoc_ex_pre, NULL}, /* Ex */ ! {mdoc_fa_pre, NULL}, /* Fa */ ! {mdoc_fd_pre, NULL}, /* Fd */ {mdoc_fl_pre, NULL}, /* Fl */ ! {mdoc_fn_pre, NULL}, /* Fn */ ! {mdoc_ft_pre, NULL}, /* Ft */ ! {mdoc_ic_pre, NULL}, /* Ic */ ! {mdoc_in_pre, NULL}, /* In */ {mdoc_li_pre, NULL}, /* Li */ ! {mdoc_nd_pre, NULL}, /* Nd */ ! {mdoc_nm_pre, NULL}, /* Nm */ {mdoc_quote_pre, mdoc_quote_post}, /* Op */ {NULL, NULL}, /* Ot */ {mdoc_pa_pre, NULL}, /* Pa */ {mdoc_rv_pre, NULL}, /* Rv */ ! {NULL, NULL}, /* St */ {mdoc_va_pre, NULL}, /* Va */ ! {mdoc_vt_pre, NULL}, /* Vt */ {mdoc_xr_pre, NULL}, /* Xr */ {mdoc__x_pre, mdoc__x_post}, /* %A */ {mdoc__x_pre, mdoc__x_post}, /* %B */ --- 132,163 ---- {mdoc_bl_pre, NULL}, /* Bl */ {NULL, NULL}, /* El */ {mdoc_it_pre, NULL}, /* It */ ! {mdoc_ad_pre, NULL}, /* Ad */ {mdoc_an_pre, NULL}, /* An */ {mdoc_ar_pre, NULL}, /* Ar */ {mdoc_cd_pre, NULL}, /* Cd */ {mdoc_fl_pre, NULL}, /* Cm */ ! {mdoc_dv_pre, NULL}, /* Dv */ ! {mdoc_er_pre, NULL}, /* Er */ ! {mdoc_ev_pre, NULL}, /* Ev */ {mdoc_ex_pre, NULL}, /* Ex */ ! {mdoc_fa_pre, NULL}, /* Fa */ ! {mdoc_fd_pre, NULL}, /* Fd */ {mdoc_fl_pre, NULL}, /* Fl */ ! {mdoc_fn_pre, NULL}, /* Fn */ ! {mdoc_ft_pre, NULL}, /* Ft */ ! {mdoc_ic_pre, NULL}, /* Ic */ ! {mdoc_in_pre, NULL}, /* In */ {mdoc_li_pre, NULL}, /* Li */ ! {mdoc_nd_pre, NULL}, /* Nd */ ! {mdoc_nm_pre, NULL}, /* Nm */ {mdoc_quote_pre, mdoc_quote_post}, /* Op */ {NULL, NULL}, /* Ot */ {mdoc_pa_pre, NULL}, /* Pa */ {mdoc_rv_pre, NULL}, /* Rv */ ! {NULL, NULL}, /* St */ {mdoc_va_pre, NULL}, /* Va */ ! {mdoc_vt_pre, NULL}, /* Vt */ {mdoc_xr_pre, NULL}, /* Xr */ {mdoc__x_pre, mdoc__x_post}, /* %A */ {mdoc__x_pre, mdoc__x_post}, /* %B */ *************** *** 175,181 **** {mdoc_quote_pre, mdoc_quote_post}, /* Aq */ {NULL, NULL}, /* At */ {NULL, NULL}, /* Bc */ ! {mdoc_bf_pre, NULL}, /* Bf */ {mdoc_quote_pre, mdoc_quote_post}, /* Bo */ {mdoc_quote_pre, mdoc_quote_post}, /* Bq */ {mdoc_xx_pre, NULL}, /* Bsx */ --- 175,181 ---- {mdoc_quote_pre, mdoc_quote_post}, /* Aq */ {NULL, NULL}, /* At */ {NULL, NULL}, /* Bc */ ! {mdoc_bf_pre, NULL}, /* Bf */ {mdoc_quote_pre, mdoc_quote_post}, /* Bo */ {mdoc_quote_pre, mdoc_quote_post}, /* Bq */ {mdoc_xx_pre, NULL}, /* Bsx */ *************** *** 186,192 **** {mdoc_quote_pre, mdoc_quote_post}, /* Dq */ {NULL, NULL}, /* Ec */ /* FIXME: no space */ {NULL, NULL}, /* Ef */ ! {mdoc_em_pre, NULL}, /* Em */ {mdoc_quote_pre, mdoc_quote_post}, /* Eo */ {mdoc_xx_pre, NULL}, /* Fx */ {mdoc_ms_pre, NULL}, /* Ms */ --- 186,192 ---- {mdoc_quote_pre, mdoc_quote_post}, /* Dq */ {NULL, NULL}, /* Ec */ /* FIXME: no space */ {NULL, NULL}, /* Ef */ ! {mdoc_em_pre, NULL}, /* Em */ {mdoc_quote_pre, mdoc_quote_post}, /* Eo */ {mdoc_xx_pre, NULL}, /* Fx */ {mdoc_ms_pre, NULL}, /* Ms */ *************** *** 207,221 **** {NULL, NULL}, /* Sc */ {mdoc_quote_pre, mdoc_quote_post}, /* So */ {mdoc_quote_pre, mdoc_quote_post}, /* Sq */ ! {mdoc_sm_pre, NULL}, /* Sm */ {mdoc_sx_pre, NULL}, /* Sx */ {mdoc_sy_pre, NULL}, /* Sy */ {NULL, NULL}, /* Tn */ {mdoc_xx_pre, NULL}, /* Ux */ {NULL, NULL}, /* Xc */ {NULL, NULL}, /* Xo */ ! {mdoc_fo_pre, mdoc_fo_post}, /* Fo */ ! {NULL, NULL}, /* Fc */ {mdoc_quote_pre, mdoc_quote_post}, /* Oo */ {NULL, NULL}, /* Oc */ {mdoc_bk_pre, mdoc_bk_post}, /* Bk */ --- 207,221 ---- {NULL, NULL}, /* Sc */ {mdoc_quote_pre, mdoc_quote_post}, /* So */ {mdoc_quote_pre, mdoc_quote_post}, /* Sq */ ! {mdoc_sm_pre, NULL}, /* Sm */ {mdoc_sx_pre, NULL}, /* Sx */ {mdoc_sy_pre, NULL}, /* Sy */ {NULL, NULL}, /* Tn */ {mdoc_xx_pre, NULL}, /* Ux */ {NULL, NULL}, /* Xc */ {NULL, NULL}, /* Xo */ ! {mdoc_fo_pre, mdoc_fo_post}, /* Fo */ ! {NULL, NULL}, /* Fc */ {mdoc_quote_pre, mdoc_quote_post}, /* Oo */ {NULL, NULL}, /* Oc */ {mdoc_bk_pre, mdoc_bk_post}, /* Bk */ *************** *** 225,245 **** {NULL, NULL}, /* Fr */ {mdoc_ud_pre, NULL}, /* Ud */ {mdoc_lb_pre, NULL}, /* Lb */ ! {mdoc_pp_pre, NULL}, /* Lp */ ! {mdoc_lk_pre, NULL}, /* Lk */ ! {mdoc_mt_pre, NULL}, /* Mt */ ! {mdoc_quote_pre, mdoc_quote_post}, /* Brq */ ! {mdoc_quote_pre, mdoc_quote_post}, /* Bro */ ! {NULL, NULL}, /* Brc */ ! {mdoc__x_pre, mdoc__x_post}, /* %C */ {NULL, NULL}, /* Es */ /* TODO */ {NULL, NULL}, /* En */ /* TODO */ ! {mdoc_xx_pre, NULL}, /* Dx */ ! {mdoc__x_pre, mdoc__x_post}, /* %Q */ {mdoc_sp_pre, NULL}, /* br */ ! {mdoc_sp_pre, NULL}, /* sp */ ! {mdoc__x_pre, mdoc__x_post}, /* %U */ ! {NULL, NULL}, /* Ta */ {mdoc_ll_pre, NULL}, /* ll */ }; --- 225,245 ---- {NULL, NULL}, /* Fr */ {mdoc_ud_pre, NULL}, /* Ud */ {mdoc_lb_pre, NULL}, /* Lb */ ! {mdoc_pp_pre, NULL}, /* Lp */ ! {mdoc_lk_pre, NULL}, /* Lk */ ! {mdoc_mt_pre, NULL}, /* Mt */ ! {mdoc_quote_pre, mdoc_quote_post}, /* Brq */ ! {mdoc_quote_pre, mdoc_quote_post}, /* Bro */ ! {NULL, NULL}, /* Brc */ ! {mdoc__x_pre, mdoc__x_post}, /* %C */ {NULL, NULL}, /* Es */ /* TODO */ {NULL, NULL}, /* En */ /* TODO */ ! {mdoc_xx_pre, NULL}, /* Dx */ ! {mdoc__x_pre, mdoc__x_post}, /* %Q */ {mdoc_sp_pre, NULL}, /* br */ ! {mdoc_sp_pre, NULL}, /* sp */ ! {mdoc__x_pre, mdoc__x_post}, /* %U */ ! {NULL, NULL}, /* Ta */ {mdoc_ll_pre, NULL}, /* ll */ }; *************** *** 258,273 **** "list-tag" }; void html_mdoc(void *arg, const struct mdoc *mdoc) { print_mdoc(mdoc_meta(mdoc), mdoc_node(mdoc), ! (struct html *)arg); putchar('\n'); } - /* * Calculate the scaling unit passed in a `-width' argument. This uses * either a native scaling unit (e.g., 1i, 2m) or the string length of --- 258,273 ---- "list-tag" }; + void html_mdoc(void *arg, const struct mdoc *mdoc) { print_mdoc(mdoc_meta(mdoc), mdoc_node(mdoc), ! (struct html *)arg); putchar('\n'); } /* * Calculate the scaling unit passed in a `-width' argument. This uses * either a native scaling unit (e.g., 1i, 2m) or the string length of *************** *** 283,289 **** } } - /* * See the same function in mdoc_term.c for documentation. */ --- 283,288 ---- *************** *** 294,320 **** if (NULL == n->prev || ! (MDOC_SYNPRETTY & n->flags)) return; ! if (n->prev->tok == n->tok && ! MDOC_Fo != n->tok && ! MDOC_Ft != n->tok && ! MDOC_Fn != n->tok) { print_otag(h, TAG_BR, 0, NULL); return; } switch (n->prev->tok) { ! case (MDOC_Fd): /* FALLTHROUGH */ ! case (MDOC_Fn): /* FALLTHROUGH */ ! case (MDOC_Fo): /* FALLTHROUGH */ ! case (MDOC_In): /* FALLTHROUGH */ ! case (MDOC_Vt): print_otag(h, TAG_P, 0, NULL); break; ! case (MDOC_Ft): if (MDOC_Fn != n->tok && MDOC_Fo != n->tok) { print_otag(h, TAG_P, 0, NULL); break; --- 293,319 ---- if (NULL == n->prev || ! (MDOC_SYNPRETTY & n->flags)) return; ! if (n->prev->tok == n->tok && ! MDOC_Fo != n->tok && ! MDOC_Ft != n->tok && ! MDOC_Fn != n->tok) { print_otag(h, TAG_BR, 0, NULL); return; } switch (n->prev->tok) { ! case MDOC_Fd: /* FALLTHROUGH */ ! case MDOC_Fn: /* FALLTHROUGH */ ! case MDOC_Fo: /* FALLTHROUGH */ ! case MDOC_In: /* FALLTHROUGH */ ! case MDOC_Vt: print_otag(h, TAG_P, 0, NULL); break; ! case MDOC_Ft: if (MDOC_Fn != n->tok && MDOC_Fo != n->tok) { print_otag(h, TAG_P, 0, NULL); break; *************** *** 326,332 **** } } - /* * Calculate the scaling unit passed in an `-offset' argument. This * uses either a native scaling unit (e.g., 1i, 2m), one of a set of --- 325,330 ---- *************** *** 348,354 **** SCALE_HS_INIT(su, html_strlen(p)); } - static void print_mdoc(MDOC_ARGS) { --- 346,351 ---- *************** *** 365,379 **** print_tagq(h, tt); print_otag(h, TAG_BODY, 0, NULL); print_otag(h, TAG_DIV, 1, &tag); ! } else t = print_otag(h, TAG_DIV, 1, &tag); print_mdoc_nodelist(meta, n, h); print_tagq(h, t); } - - /* ARGSUSED */ static void print_mdoc_head(MDOC_ARGS) { --- 362,374 ---- print_tagq(h, tt); print_otag(h, TAG_BODY, 0, NULL); print_otag(h, TAG_DIV, 1, &tag); ! } else t = print_otag(h, TAG_DIV, 1, &tag); print_mdoc_nodelist(meta, n, h); print_tagq(h, t); } static void print_mdoc_head(MDOC_ARGS) { *************** *** 389,395 **** print_text(h, h->buf); } - static void print_mdoc_nodelist(MDOC_ARGS) { --- 384,389 ---- *************** *** 399,405 **** print_mdoc_nodelist(meta, n->next, h); } - static void print_mdoc_node(MDOC_ARGS) { --- 393,398 ---- *************** *** 410,419 **** t = h->tags.head; switch (n->type) { ! case (MDOC_ROOT): child = mdoc_root_pre(meta, n, h); break; ! case (MDOC_TEXT): /* No tables in this mode... */ assert(NULL == h->tblt); --- 403,412 ---- t = h->tags.head; switch (n->type) { ! case MDOC_ROOT: child = mdoc_root_pre(meta, n, h); break; ! case MDOC_TEXT: /* No tables in this mode... */ assert(NULL == h->tblt); *************** *** 430,439 **** if (MDOC_DELIMO & n->flags) h->flags |= HTML_NOSPACE; return; ! case (MDOC_EQN): print_eqn(h, n->eqn); break; ! case (MDOC_TBL): /* * This will take care of initialising all of the table * state data for the first table, then tearing it down --- 423,432 ---- if (MDOC_DELIMO & n->flags) h->flags |= HTML_NOSPACE; return; ! case MDOC_EQN: print_eqn(h, n->eqn); break; ! case MDOC_TBL: /* * This will take care of initialising all of the table * state data for the first table, then tearing it down *************** *** 472,481 **** print_stagq(h, t); switch (n->type) { ! case (MDOC_ROOT): mdoc_root_post(meta, n, h); break; ! case (MDOC_EQN): break; default: if (mdocs[n->tok].post && ENDBODY_NOT == n->end) --- 465,474 ---- print_stagq(h, t); switch (n->type) { ! case MDOC_ROOT: mdoc_root_post(meta, n, h); break; ! case MDOC_EQN: break; default: if (mdocs[n->tok].post && ENDBODY_NOT == n->end) *************** *** 484,490 **** } } - /* ARGSUSED */ static void mdoc_root_post(MDOC_ARGS) { --- 477,482 ---- *************** *** 515,522 **** print_tagq(h, t); } - - /* ARGSUSED */ static int mdoc_root_pre(MDOC_ARGS) { --- 507,512 ---- *************** *** 566,573 **** return(1); } - - /* ARGSUSED */ static int mdoc_sh_pre(MDOC_ARGS) { --- 556,561 ---- *************** *** 598,604 **** return(1); } - /* ARGSUSED */ static int mdoc_ss_pre(MDOC_ARGS) { --- 586,591 ---- *************** *** 629,636 **** return(1); } - - /* ARGSUSED */ static int mdoc_fl_pre(MDOC_ARGS) { --- 616,621 ---- *************** *** 654,661 **** return(1); } - - /* ARGSUSED */ static int mdoc_nd_pre(MDOC_ARGS) { --- 639,644 ---- *************** *** 672,678 **** return(1); } - static int mdoc_nm_pre(MDOC_ARGS) { --- 655,660 ---- *************** *** 681,699 **** int len; switch (n->type) { ! case (MDOC_ELEM): synopsis_pre(h, n); PAIR_CLASS_INIT(&tag, "name"); print_otag(h, TAG_B, 1, &tag); if (NULL == n->child && meta->name) print_text(h, meta->name); return(1); ! case (MDOC_HEAD): print_otag(h, TAG_TD, 0, NULL); if (NULL == n->child && meta->name) print_text(h, meta->name); return(1); ! case (MDOC_BODY): print_otag(h, TAG_TD, 0, NULL); return(1); default: --- 663,681 ---- int len; switch (n->type) { ! case MDOC_ELEM: synopsis_pre(h, n); PAIR_CLASS_INIT(&tag, "name"); print_otag(h, TAG_B, 1, &tag); if (NULL == n->child && meta->name) print_text(h, meta->name); return(1); ! case MDOC_HEAD: print_otag(h, TAG_TD, 0, NULL); if (NULL == n->child && meta->name) print_text(h, meta->name); return(1); ! case MDOC_BODY: print_otag(h, TAG_TD, 0, NULL); return(1); default: *************** *** 722,729 **** return(1); } - - /* ARGSUSED */ static int mdoc_xr_pre(MDOC_ARGS) { --- 704,709 ---- *************** *** 735,743 **** PAIR_CLASS_INIT(&tag[0], "link-man"); if (h->base_man) { ! buffmt_man(h, n->child->string, ! n->child->next ? ! n->child->next->string : NULL); PAIR_HREF_INIT(&tag[1], h->buf); print_otag(h, TAG_A, 2, tag); } else --- 715,723 ---- PAIR_CLASS_INIT(&tag[0], "link-man"); if (h->base_man) { ! buffmt_man(h, n->child->string, ! n->child->next ? ! n->child->next->string : NULL); PAIR_HREF_INIT(&tag[1], h->buf); print_otag(h, TAG_A, 2, tag); } else *************** *** 758,765 **** return(0); } - - /* ARGSUSED */ static int mdoc_ns_pre(MDOC_ARGS) { --- 738,743 ---- *************** *** 769,776 **** return(1); } - - /* ARGSUSED */ static int mdoc_ar_pre(MDOC_ARGS) { --- 747,752 ---- *************** *** 781,788 **** return(1); } - - /* ARGSUSED */ static int mdoc_xx_pre(MDOC_ARGS) { --- 757,762 ---- *************** *** 791,812 **** int flags; switch (n->tok) { ! case (MDOC_Bsx): pp = "BSD/OS"; break; ! case (MDOC_Dx): pp = "DragonFly"; break; ! case (MDOC_Fx): pp = "FreeBSD"; break; ! case (MDOC_Nx): pp = "NetBSD"; break; ! case (MDOC_Ox): pp = "OpenBSD"; break; ! case (MDOC_Ux): pp = "UNIX"; break; default: --- 765,786 ---- int flags; switch (n->tok) { ! case MDOC_Bsx: pp = "BSD/OS"; break; ! case MDOC_Dx: pp = "DragonFly"; break; ! case MDOC_Fx: pp = "FreeBSD"; break; ! case MDOC_Nx: pp = "NetBSD"; break; ! case MDOC_Ox: pp = "OpenBSD"; break; ! case MDOC_Ux: pp = "UNIX"; break; default: *************** *** 826,833 **** return(0); } - - /* ARGSUSED */ static int mdoc_bx_pre(MDOC_ARGS) { --- 800,805 ---- *************** *** 855,861 **** return(0); } - /* ARGSUSED */ static int mdoc_it_pre(MDOC_ARGS) { --- 827,832 ---- *************** *** 879,903 **** if (MDOC_HEAD == n->type) { switch (type) { ! case(LIST_bullet): /* FALLTHROUGH */ ! case(LIST_dash): /* FALLTHROUGH */ ! case(LIST_item): /* FALLTHROUGH */ ! case(LIST_hyphen): /* FALLTHROUGH */ ! case(LIST_enum): return(0); ! case(LIST_diag): /* FALLTHROUGH */ ! case(LIST_hang): /* FALLTHROUGH */ ! case(LIST_inset): /* FALLTHROUGH */ ! case(LIST_ohang): /* FALLTHROUGH */ ! case(LIST_tag): SCALE_VS_INIT(&su, ! bl->norm->Bl.comp); bufcat_su(h, "margin-top", &su); PAIR_STYLE_INIT(&tag[1], h); --- 850,874 ---- if (MDOC_HEAD == n->type) { switch (type) { ! case LIST_bullet: /* FALLTHROUGH */ ! case LIST_dash: /* FALLTHROUGH */ ! case LIST_item: /* FALLTHROUGH */ ! case LIST_hyphen: /* FALLTHROUGH */ ! case LIST_enum: return(0); ! case LIST_diag: /* FALLTHROUGH */ ! case LIST_hang: /* FALLTHROUGH */ ! case LIST_inset: /* FALLTHROUGH */ ! case LIST_ohang: /* FALLTHROUGH */ ! case LIST_tag: SCALE_VS_INIT(&su, ! bl->norm->Bl.comp); bufcat_su(h, "margin-top", &su); PAIR_STYLE_INIT(&tag[1], h); *************** *** 907,942 **** PAIR_CLASS_INIT(&tag[0], "diag"); print_otag(h, TAG_B, 1, tag); break; ! case(LIST_column): break; default: break; } } else if (MDOC_BODY == n->type) { switch (type) { ! case(LIST_bullet): /* FALLTHROUGH */ ! case(LIST_hyphen): /* FALLTHROUGH */ ! case(LIST_dash): /* FALLTHROUGH */ ! case(LIST_enum): /* FALLTHROUGH */ ! case(LIST_item): SCALE_VS_INIT(&su, ! bl->norm->Bl.comp); bufcat_su(h, "margin-top", &su); PAIR_STYLE_INIT(&tag[1], h); print_otag(h, TAG_LI, 2, tag); break; ! case(LIST_diag): /* FALLTHROUGH */ ! case(LIST_hang): /* FALLTHROUGH */ ! case(LIST_inset): /* FALLTHROUGH */ ! case(LIST_ohang): /* FALLTHROUGH */ ! case(LIST_tag): if (NULL == bl->norm->Bl.width) { print_otag(h, TAG_DD, 1, tag); break; --- 878,913 ---- PAIR_CLASS_INIT(&tag[0], "diag"); print_otag(h, TAG_B, 1, tag); break; ! case LIST_column: break; default: break; } } else if (MDOC_BODY == n->type) { switch (type) { ! case LIST_bullet: /* FALLTHROUGH */ ! case LIST_hyphen: /* FALLTHROUGH */ ! case LIST_dash: /* FALLTHROUGH */ ! case LIST_enum: /* FALLTHROUGH */ ! case LIST_item: SCALE_VS_INIT(&su, ! bl->norm->Bl.comp); bufcat_su(h, "margin-top", &su); PAIR_STYLE_INIT(&tag[1], h); print_otag(h, TAG_LI, 2, tag); break; ! case LIST_diag: /* FALLTHROUGH */ ! case LIST_hang: /* FALLTHROUGH */ ! case LIST_inset: /* FALLTHROUGH */ ! case LIST_ohang: /* FALLTHROUGH */ ! case LIST_tag: if (NULL == bl->norm->Bl.width) { print_otag(h, TAG_DD, 1, tag); break; *************** *** 946,952 **** PAIR_STYLE_INIT(&tag[1], h); print_otag(h, TAG_DD, 2, tag); break; ! case(LIST_column): SCALE_VS_INIT(&su, ! bl->norm->Bl.comp); bufcat_su(h, "margin-top", &su); PAIR_STYLE_INIT(&tag[1], h); --- 917,923 ---- PAIR_STYLE_INIT(&tag[1], h); print_otag(h, TAG_DD, 2, tag); break; ! case LIST_column: SCALE_VS_INIT(&su, ! bl->norm->Bl.comp); bufcat_su(h, "margin-top", &su); PAIR_STYLE_INIT(&tag[1], h); *************** *** 957,963 **** } } else { switch (type) { ! case (LIST_column): print_otag(h, TAG_TR, 1, tag); break; default: --- 928,934 ---- } } else { switch (type) { ! case LIST_column: print_otag(h, TAG_TR, 1, tag); break; default: *************** *** 968,974 **** return(1); } - /* ARGSUSED */ static int mdoc_bl_pre(MDOC_ARGS) { --- 939,944 ---- *************** *** 1027,1056 **** } switch (n->norm->Bl.type) { ! case(LIST_bullet): /* FALLTHROUGH */ ! case(LIST_dash): /* FALLTHROUGH */ ! case(LIST_hyphen): /* FALLTHROUGH */ ! case(LIST_item): print_otag(h, TAG_UL, 2, tag); break; ! case(LIST_enum): print_otag(h, TAG_OL, 2, tag); break; ! case(LIST_diag): /* FALLTHROUGH */ ! case(LIST_hang): /* FALLTHROUGH */ ! case(LIST_inset): /* FALLTHROUGH */ ! case(LIST_ohang): /* FALLTHROUGH */ ! case(LIST_tag): print_otag(h, TAG_DL, 2, tag); break; ! case(LIST_column): print_otag(h, TAG_TABLE, 2, tag); break; default: --- 997,1026 ---- } switch (n->norm->Bl.type) { ! case LIST_bullet: /* FALLTHROUGH */ ! case LIST_dash: /* FALLTHROUGH */ ! case LIST_hyphen: /* FALLTHROUGH */ ! case LIST_item: print_otag(h, TAG_UL, 2, tag); break; ! case LIST_enum: print_otag(h, TAG_OL, 2, tag); break; ! case LIST_diag: /* FALLTHROUGH */ ! case LIST_hang: /* FALLTHROUGH */ ! case LIST_inset: /* FALLTHROUGH */ ! case LIST_ohang: /* FALLTHROUGH */ ! case LIST_tag: print_otag(h, TAG_DL, 2, tag); break; ! case LIST_column: print_otag(h, TAG_TABLE, 2, tag); break; default: *************** *** 1061,1067 **** return(1); } - /* ARGSUSED */ static int mdoc_ex_pre(MDOC_ARGS) { --- 1031,1036 ---- *************** *** 1098,1109 **** else print_text(h, "utility exits"); ! print_text(h, "0 on success, and >0 if an error occurs."); return(0); } - - /* ARGSUSED */ static int mdoc_em_pre(MDOC_ARGS) { --- 1067,1076 ---- else print_text(h, "utility exits"); ! print_text(h, "0 on success, and >0 if an error occurs."); return(0); } static int mdoc_em_pre(MDOC_ARGS) { *************** *** 1114,1121 **** return(1); } - - /* ARGSUSED */ static int mdoc_d1_pre(MDOC_ARGS) { --- 1081,1086 ---- *************** *** 1140,1152 **** if (MDOC_Dl == n->tok) { PAIR_CLASS_INIT(&tag[0], "lit"); print_otag(h, TAG_CODE, 1, tag); ! } return(1); } - - /* ARGSUSED */ static int mdoc_sx_pre(MDOC_ARGS) { --- 1105,1115 ---- if (MDOC_Dl == n->tok) { PAIR_CLASS_INIT(&tag[0], "lit"); print_otag(h, TAG_CODE, 1, tag); ! } return(1); } static int mdoc_sx_pre(MDOC_ARGS) { *************** *** 1169,1181 **** return(1); } - - /* ARGSUSED */ static int mdoc_bd_pre(MDOC_ARGS) { ! struct htmlpair tag[2]; ! int comp, sv; const struct mdoc_node *nn; struct roffsu su; --- 1132,1142 ---- return(1); } static int mdoc_bd_pre(MDOC_ARGS) { ! struct htmlpair tag[2]; ! int comp, sv; const struct mdoc_node *nn; struct roffsu su; *************** *** 1200,1212 **** SCALE_HS_INIT(&su, 0); if (n->norm->Bd.offs) a2offs(n->norm->Bd.offs, &su); ! bufinit(h); bufcat_su(h, "margin-left", &su); PAIR_STYLE_INIT(&tag[0], h); ! if (DISP_unfilled != n->norm->Bd.type && ! DISP_literal != n->norm->Bd.type) { PAIR_CLASS_INIT(&tag[1], "display"); print_otag(h, TAG_DIV, 2, tag); return(1); --- 1161,1173 ---- SCALE_HS_INIT(&su, 0); if (n->norm->Bd.offs) a2offs(n->norm->Bd.offs, &su); ! bufinit(h); bufcat_su(h, "margin-left", &su); PAIR_STYLE_INIT(&tag[0], h); ! if (DISP_unfilled != n->norm->Bd.type && ! DISP_literal != n->norm->Bd.type) { PAIR_CLASS_INIT(&tag[1], "display"); print_otag(h, TAG_DIV, 2, tag); return(1); *************** *** 1229,1249 **** * anyway, so don't sweat it. */ switch (nn->tok) { ! case (MDOC_Sm): /* FALLTHROUGH */ ! case (MDOC_br): /* FALLTHROUGH */ ! case (MDOC_sp): /* FALLTHROUGH */ ! case (MDOC_Bl): /* FALLTHROUGH */ ! case (MDOC_D1): /* FALLTHROUGH */ ! case (MDOC_Dl): /* FALLTHROUGH */ ! case (MDOC_Lp): /* FALLTHROUGH */ ! case (MDOC_Pp): continue; default: break; --- 1190,1210 ---- * anyway, so don't sweat it. */ switch (nn->tok) { ! case MDOC_Sm: /* FALLTHROUGH */ ! case MDOC_br: /* FALLTHROUGH */ ! case MDOC_sp: /* FALLTHROUGH */ ! case MDOC_Bl: /* FALLTHROUGH */ ! case MDOC_D1: /* FALLTHROUGH */ ! case MDOC_Dl: /* FALLTHROUGH */ ! case MDOC_Lp: /* FALLTHROUGH */ ! case MDOC_Pp: continue; default: break; *************** *** 1262,1269 **** return(0); } - - /* ARGSUSED */ static int mdoc_pa_pre(MDOC_ARGS) { --- 1223,1228 ---- *************** *** 1274,1281 **** return(1); } - - /* ARGSUSED */ static int mdoc_ad_pre(MDOC_ARGS) { --- 1233,1238 ---- *************** *** 1286,1293 **** return(1); } - - /* ARGSUSED */ static int mdoc_an_pre(MDOC_ARGS) { --- 1243,1248 ---- *************** *** 1300,1307 **** return(1); } - - /* ARGSUSED */ static int mdoc_cd_pre(MDOC_ARGS) { --- 1255,1260 ---- *************** *** 1313,1320 **** return(1); } - - /* ARGSUSED */ static int mdoc_dv_pre(MDOC_ARGS) { --- 1266,1271 ---- *************** *** 1325,1332 **** return(1); } - - /* ARGSUSED */ static int mdoc_ev_pre(MDOC_ARGS) { --- 1276,1281 ---- *************** *** 1337,1344 **** return(1); } - - /* ARGSUSED */ static int mdoc_er_pre(MDOC_ARGS) { --- 1286,1291 ---- *************** *** 1349,1356 **** return(1); } - - /* ARGSUSED */ static int mdoc_fa_pre(MDOC_ARGS) { --- 1296,1301 ---- *************** *** 1382,1389 **** return(0); } - - /* ARGSUSED */ static int mdoc_fd_pre(MDOC_ARGS) { --- 1327,1332 ---- *************** *** 1412,1432 **** if (NULL != (n = n->next)) { assert(MDOC_TEXT == n->type); ! strlcpy(buf, '<' == *n->string || '"' == *n->string ? ! n->string + 1 : n->string, BUFSIZ); sz = strlen(buf); if (sz && ('>' == buf[sz - 1] || '"' == buf[sz - 1])) buf[sz - 1] = '\0'; PAIR_CLASS_INIT(&tag[0], "link-includes"); ! i = 1; if (h->base_includes) { buffmt_includes(h, buf); PAIR_HREF_INIT(&tag[i], h->buf); i++; ! } t = print_otag(h, TAG_A, i, tag); print_text(h, n->string); --- 1355,1375 ---- if (NULL != (n = n->next)) { assert(MDOC_TEXT == n->type); ! strlcpy(buf, '<' == *n->string || '"' == *n->string ? ! n->string + 1 : n->string, BUFSIZ); sz = strlen(buf); if (sz && ('>' == buf[sz - 1] || '"' == buf[sz - 1])) buf[sz - 1] = '\0'; PAIR_CLASS_INIT(&tag[0], "link-includes"); ! i = 1; if (h->base_includes) { buffmt_includes(h, buf); PAIR_HREF_INIT(&tag[i], h->buf); i++; ! } t = print_otag(h, TAG_A, i, tag); print_text(h, n->string); *************** *** 1443,1450 **** return(0); } - - /* ARGSUSED */ static int mdoc_vt_pre(MDOC_ARGS) { --- 1386,1391 ---- *************** *** 1463,1470 **** return(1); } - - /* ARGSUSED */ static int mdoc_ft_pre(MDOC_ARGS) { --- 1404,1409 ---- *************** *** 1476,1483 **** return(1); } - - /* ARGSUSED */ static int mdoc_fn_pre(MDOC_ARGS) { --- 1415,1420 ---- *************** *** 1498,1504 **** if (NULL != ep) { PAIR_CLASS_INIT(&tag[0], "ftype"); t = print_otag(h, TAG_I, 1, tag); ! while (ep) { sz = MIN((int)(ep - sp), BUFSIZ - 1); (void)memcpy(nbuf, sp, (size_t)sz); --- 1435,1441 ---- if (NULL != ep) { PAIR_CLASS_INIT(&tag[0], "ftype"); t = print_otag(h, TAG_I, 1, tag); ! while (ep) { sz = MIN((int)(ep - sp), BUFSIZ - 1); (void)memcpy(nbuf, sp, (size_t)sz); *************** *** 1570,1584 **** return(0); } - - /* ARGSUSED */ static int mdoc_sm_pre(MDOC_ARGS) { assert(n->child && MDOC_TEXT == n->child->type); if (0 == strcmp("on", n->child->string)) { ! /* * FIXME: no p->col to check. Thus, if we have * .Bd -literal * .Sm off --- 1507,1519 ---- return(0); } static int mdoc_sm_pre(MDOC_ARGS) { assert(n->child && MDOC_TEXT == n->child->type); if (0 == strcmp("on", n->child->string)) { ! /* * FIXME: no p->col to check. Thus, if we have * .Bd -literal * .Sm off *************** *** 1596,1602 **** return(0); } - /* ARGSUSED */ static int mdoc_ll_pre(MDOC_ARGS) { --- 1531,1536 ---- *************** *** 1604,1610 **** return(0); } - /* ARGSUSED */ static int mdoc_pp_pre(MDOC_ARGS) { --- 1538,1543 ---- *************** *** 1613,1619 **** return(0); } - /* ARGSUSED */ static int mdoc_sp_pre(MDOC_ARGS) { --- 1546,1551 ---- *************** *** 1641,1647 **** } - /* ARGSUSED */ static int mdoc_lk_pre(MDOC_ARGS) { --- 1573,1578 ---- *************** *** 1666,1673 **** return(0); } - - /* ARGSUSED */ static int mdoc_mt_pre(MDOC_ARGS) { --- 1597,1602 ---- *************** *** 1688,1699 **** print_text(h, n->string); print_tagq(h, t); } ! return(0); } - - /* ARGSUSED */ static int mdoc_fo_pre(MDOC_ARGS) { --- 1617,1626 ---- print_text(h, n->string); print_tagq(h, t); } ! return(0); } static int mdoc_fo_pre(MDOC_ARGS) { *************** *** 1722,1729 **** return(0); } - - /* ARGSUSED */ static void mdoc_fo_post(MDOC_ARGS) { --- 1649,1654 ---- *************** *** 1736,1743 **** print_text(h, ";"); } - - /* ARGSUSED */ static int mdoc_in_pre(MDOC_ARGS) { --- 1661,1666 ---- *************** *** 1773,1779 **** buffmt_includes(h, n->string); PAIR_HREF_INIT(&tag[i], h->buf); i++; ! } t = print_otag(h, TAG_A, i, tag); print_text(h, n->string); --- 1696,1702 ---- buffmt_includes(h, n->string); PAIR_HREF_INIT(&tag[i], h->buf); i++; ! } t = print_otag(h, TAG_A, i, tag); print_text(h, n->string); *************** *** 1793,1800 **** return(0); } - - /* ARGSUSED */ static int mdoc_ic_pre(MDOC_ARGS) { --- 1716,1721 ---- *************** *** 1805,1812 **** return(1); } - - /* ARGSUSED */ static int mdoc_rv_pre(MDOC_ARGS) { --- 1726,1731 ---- *************** *** 1846,1864 **** else print_text(h, "function returns"); ! print_text(h, "the value 0 if successful; otherwise the value " ! "-1 is returned and the global variable"); PAIR_CLASS_INIT(&tag, "var"); t = print_otag(h, TAG_B, 1, &tag); print_text(h, "errno"); print_tagq(h, t); ! print_text(h, "is set to indicate the error."); return(0); } - - /* ARGSUSED */ static int mdoc_va_pre(MDOC_ARGS) { --- 1765,1781 ---- else print_text(h, "function returns"); ! print_text(h, "the value 0 if successful; otherwise the " ! "value -1 is returned and the global variable"); PAIR_CLASS_INIT(&tag, "var"); t = print_otag(h, TAG_B, 1, &tag); print_text(h, "errno"); print_tagq(h, t); ! print_text(h, "is set to indicate the error."); return(0); } static int mdoc_va_pre(MDOC_ARGS) { *************** *** 1869,1888 **** return(1); } - - /* ARGSUSED */ static int mdoc_ap_pre(MDOC_ARGS) { ! h->flags |= HTML_NOSPACE; print_text(h, "\\(aq"); h->flags |= HTML_NOSPACE; return(1); } - - /* ARGSUSED */ static int mdoc_bf_pre(MDOC_ARGS) { --- 1786,1801 ---- return(1); } static int mdoc_ap_pre(MDOC_ARGS) { ! h->flags |= HTML_NOSPACE; print_text(h, "\\(aq"); h->flags |= HTML_NOSPACE; return(1); } static int mdoc_bf_pre(MDOC_ARGS) { *************** *** 1894,1911 **** else if (MDOC_BODY != n->type) return(1); ! if (FONT_Em == n->norm->Bf.font) PAIR_CLASS_INIT(&tag[0], "emph"); ! else if (FONT_Sy == n->norm->Bf.font) PAIR_CLASS_INIT(&tag[0], "symb"); ! else if (FONT_Li == n->norm->Bf.font) PAIR_CLASS_INIT(&tag[0], "lit"); else PAIR_CLASS_INIT(&tag[0], "none"); ! /* * We want this to be inline-formatted, but needs to be div to ! * accept block children. */ bufinit(h); bufcat_style(h, "display", "inline"); --- 1807,1824 ---- else if (MDOC_BODY != n->type) return(1); ! if (FONT_Em == n->norm->Bf.font) PAIR_CLASS_INIT(&tag[0], "emph"); ! else if (FONT_Sy == n->norm->Bf.font) PAIR_CLASS_INIT(&tag[0], "symb"); ! else if (FONT_Li == n->norm->Bf.font) PAIR_CLASS_INIT(&tag[0], "lit"); else PAIR_CLASS_INIT(&tag[0], "none"); ! /* * We want this to be inline-formatted, but needs to be div to ! * accept block children. */ bufinit(h); bufcat_style(h, "display", "inline"); *************** *** 1917,1924 **** return(1); } - - /* ARGSUSED */ static int mdoc_ms_pre(MDOC_ARGS) { --- 1830,1835 ---- *************** *** 1929,1936 **** return(1); } - - /* ARGSUSED */ static int mdoc_igndelim_pre(MDOC_ARGS) { --- 1840,1845 ---- *************** *** 1939,1946 **** return(1); } - - /* ARGSUSED */ static void mdoc_pf_post(MDOC_ARGS) { --- 1848,1853 ---- *************** *** 1948,1955 **** h->flags |= HTML_NOSPACE; } - - /* ARGSUSED */ static int mdoc_rs_pre(MDOC_ARGS) { --- 1855,1860 ---- *************** *** 1966,1974 **** return(1); } - - - /* ARGSUSED */ static int mdoc_li_pre(MDOC_ARGS) { --- 1871,1876 ---- *************** *** 1979,1986 **** return(1); } - - /* ARGSUSED */ static int mdoc_sy_pre(MDOC_ARGS) { --- 1881,1886 ---- *************** *** 1991,1998 **** return(1); } - - /* ARGSUSED */ static int mdoc_bt_pre(MDOC_ARGS) { --- 1891,1896 ---- *************** *** 2001,2008 **** return(0); } - - /* ARGSUSED */ static int mdoc_ud_pre(MDOC_ARGS) { --- 1899,1904 ---- *************** *** 2011,2018 **** return(0); } - - /* ARGSUSED */ static int mdoc_lb_pre(MDOC_ARGS) { --- 1907,1912 ---- *************** *** 2026,2033 **** return(1); } - - /* ARGSUSED */ static int mdoc__x_pre(MDOC_ARGS) { --- 1920,1925 ---- *************** *** 2037,2088 **** t = TAG_SPAN; 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"); t = TAG_I; break; ! case(MDOC__C): PAIR_CLASS_INIT(&tag[0], "ref-city"); break; ! case(MDOC__D): PAIR_CLASS_INIT(&tag[0], "ref-date"); break; ! case(MDOC__I): PAIR_CLASS_INIT(&tag[0], "ref-issue"); t = TAG_I; break; ! case(MDOC__J): PAIR_CLASS_INIT(&tag[0], "ref-jrnl"); t = TAG_I; break; ! case(MDOC__N): PAIR_CLASS_INIT(&tag[0], "ref-num"); break; ! case(MDOC__O): PAIR_CLASS_INIT(&tag[0], "ref-opt"); break; ! case(MDOC__P): PAIR_CLASS_INIT(&tag[0], "ref-page"); break; ! case(MDOC__Q): PAIR_CLASS_INIT(&tag[0], "ref-corp"); break; ! case(MDOC__R): PAIR_CLASS_INIT(&tag[0], "ref-rep"); break; ! case(MDOC__T): PAIR_CLASS_INIT(&tag[0], "ref-title"); break; ! case(MDOC__U): PAIR_CLASS_INIT(&tag[0], "link-ref"); break; ! case(MDOC__V): PAIR_CLASS_INIT(&tag[0], "ref-vol"); break; default: --- 1929,1980 ---- t = TAG_SPAN; 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"); t = TAG_I; break; ! case MDOC__C: PAIR_CLASS_INIT(&tag[0], "ref-city"); break; ! case MDOC__D: PAIR_CLASS_INIT(&tag[0], "ref-date"); break; ! case MDOC__I: PAIR_CLASS_INIT(&tag[0], "ref-issue"); t = TAG_I; break; ! case MDOC__J: PAIR_CLASS_INIT(&tag[0], "ref-jrnl"); t = TAG_I; break; ! case MDOC__N: PAIR_CLASS_INIT(&tag[0], "ref-num"); break; ! case MDOC__O: PAIR_CLASS_INIT(&tag[0], "ref-opt"); break; ! case MDOC__P: PAIR_CLASS_INIT(&tag[0], "ref-page"); break; ! case MDOC__Q: PAIR_CLASS_INIT(&tag[0], "ref-corp"); break; ! case MDOC__R: PAIR_CLASS_INIT(&tag[0], "ref-rep"); break; ! case MDOC__T: PAIR_CLASS_INIT(&tag[0], "ref-title"); break; ! case MDOC__U: PAIR_CLASS_INIT(&tag[0], "link-ref"); break; ! case MDOC__V: PAIR_CLASS_INIT(&tag[0], "ref-vol"); break; default: *************** *** 2101,2108 **** return(1); } - - /* ARGSUSED */ static void mdoc__x_post(MDOC_ARGS) { --- 1993,1998 ---- *************** *** 2121,2138 **** print_text(h, n->next ? "," : "."); } - - /* ARGSUSED */ static int mdoc_bk_pre(MDOC_ARGS) { switch (n->type) { ! case (MDOC_BLOCK): break; ! case (MDOC_HEAD): return(0); ! case (MDOC_BODY): if (n->parent->args || 0 == n->prev->nchild) h->flags |= HTML_PREKEEP; break; --- 2011,2026 ---- print_text(h, n->next ? "," : "."); } static int mdoc_bk_pre(MDOC_ARGS) { switch (n->type) { ! case MDOC_BLOCK: break; ! case MDOC_HEAD: return(0); ! case MDOC_BODY: if (n->parent->args || 0 == n->prev->nchild) h->flags |= HTML_PREKEEP; break; *************** *** 2144,2151 **** return(1); } - - /* ARGSUSED */ static void mdoc_bk_post(MDOC_ARGS) { --- 2032,2037 ---- *************** *** 2154,2161 **** h->flags &= ~(HTML_KEEP | HTML_PREKEEP); } - - /* ARGSUSED */ static int mdoc_quote_pre(MDOC_ARGS) { --- 2040,2045 ---- *************** *** 2165,2218 **** return(1); switch (n->tok) { ! case (MDOC_Ao): /* FALLTHROUGH */ ! case (MDOC_Aq): print_text(h, "\\(la"); break; ! case (MDOC_Bro): /* FALLTHROUGH */ ! case (MDOC_Brq): print_text(h, "\\(lC"); break; ! case (MDOC_Bo): /* FALLTHROUGH */ ! case (MDOC_Bq): print_text(h, "\\(lB"); break; ! case (MDOC_Oo): /* FALLTHROUGH */ ! case (MDOC_Op): print_text(h, "\\(lB"); h->flags |= HTML_NOSPACE; PAIR_CLASS_INIT(&tag, "opt"); print_otag(h, TAG_SPAN, 1, &tag); break; ! case (MDOC_Eo): break; ! case (MDOC_Do): /* FALLTHROUGH */ ! case (MDOC_Dq): /* FALLTHROUGH */ ! case (MDOC_Qo): /* FALLTHROUGH */ ! case (MDOC_Qq): print_text(h, "\\(lq"); break; ! case (MDOC_Po): /* FALLTHROUGH */ ! case (MDOC_Pq): print_text(h, "("); break; ! case (MDOC_Ql): print_text(h, "\\(oq"); h->flags |= HTML_NOSPACE; PAIR_CLASS_INIT(&tag, "lit"); print_otag(h, TAG_CODE, 1, &tag); break; ! case (MDOC_So): /* FALLTHROUGH */ ! case (MDOC_Sq): print_text(h, "\\(oq"); break; default: --- 2049,2102 ---- return(1); switch (n->tok) { ! case MDOC_Ao: /* FALLTHROUGH */ ! case MDOC_Aq: print_text(h, "\\(la"); break; ! case MDOC_Bro: /* FALLTHROUGH */ ! case MDOC_Brq: print_text(h, "\\(lC"); break; ! case MDOC_Bo: /* FALLTHROUGH */ ! case MDOC_Bq: print_text(h, "\\(lB"); break; ! case MDOC_Oo: /* FALLTHROUGH */ ! case MDOC_Op: print_text(h, "\\(lB"); h->flags |= HTML_NOSPACE; PAIR_CLASS_INIT(&tag, "opt"); print_otag(h, TAG_SPAN, 1, &tag); break; ! case MDOC_Eo: break; ! case MDOC_Do: /* FALLTHROUGH */ ! case MDOC_Dq: /* FALLTHROUGH */ ! case MDOC_Qo: /* FALLTHROUGH */ ! case MDOC_Qq: print_text(h, "\\(lq"); break; ! case MDOC_Po: /* FALLTHROUGH */ ! case MDOC_Pq: print_text(h, "("); break; ! case MDOC_Ql: print_text(h, "\\(oq"); h->flags |= HTML_NOSPACE; PAIR_CLASS_INIT(&tag, "lit"); print_otag(h, TAG_CODE, 1, &tag); break; ! case MDOC_So: /* FALLTHROUGH */ ! case MDOC_Sq: print_text(h, "\\(oq"); break; default: *************** *** 2224,2231 **** return(1); } - - /* ARGSUSED */ static void mdoc_quote_post(MDOC_ARGS) { --- 2108,2113 ---- *************** *** 2236,2281 **** h->flags |= HTML_NOSPACE; switch (n->tok) { ! case (MDOC_Ao): /* FALLTHROUGH */ ! case (MDOC_Aq): print_text(h, "\\(ra"); break; ! case (MDOC_Bro): /* FALLTHROUGH */ ! case (MDOC_Brq): print_text(h, "\\(rC"); break; ! case (MDOC_Oo): /* FALLTHROUGH */ ! case (MDOC_Op): /* FALLTHROUGH */ ! case (MDOC_Bo): /* FALLTHROUGH */ ! case (MDOC_Bq): print_text(h, "\\(rB"); break; ! case (MDOC_Eo): break; ! case (MDOC_Qo): /* FALLTHROUGH */ ! case (MDOC_Qq): /* FALLTHROUGH */ ! case (MDOC_Do): /* FALLTHROUGH */ ! case (MDOC_Dq): print_text(h, "\\(rq"); break; ! case (MDOC_Po): /* FALLTHROUGH */ ! case (MDOC_Pq): print_text(h, ")"); break; ! case (MDOC_Ql): /* FALLTHROUGH */ ! case (MDOC_So): /* FALLTHROUGH */ ! case (MDOC_Sq): print_text(h, "\\(cq"); break; default: --- 2118,2163 ---- h->flags |= HTML_NOSPACE; switch (n->tok) { ! case MDOC_Ao: /* FALLTHROUGH */ ! case MDOC_Aq: print_text(h, "\\(ra"); break; ! case MDOC_Bro: /* FALLTHROUGH */ ! case MDOC_Brq: print_text(h, "\\(rC"); break; ! case MDOC_Oo: /* FALLTHROUGH */ ! case MDOC_Op: /* FALLTHROUGH */ ! case MDOC_Bo: /* FALLTHROUGH */ ! case MDOC_Bq: print_text(h, "\\(rB"); break; ! case MDOC_Eo: break; ! case MDOC_Qo: /* FALLTHROUGH */ ! case MDOC_Qq: /* FALLTHROUGH */ ! case MDOC_Do: /* FALLTHROUGH */ ! case MDOC_Dq: print_text(h, "\\(rq"); break; ! case MDOC_Po: /* FALLTHROUGH */ ! case MDOC_Pq: print_text(h, ")"); break; ! case MDOC_Ql: /* FALLTHROUGH */ ! case MDOC_So: /* FALLTHROUGH */ ! case MDOC_Sq: print_text(h, "\\(cq"); break; default: *************** *** 2283,2287 **** /* NOTREACHED */ } } - - --- 2165,2167 ----