=================================================================== RCS file: /cvs/mandoc/man_html.c,v retrieving revision 1.137 retrieving revision 1.140 diff -u -p -r1.137 -r1.140 --- mandoc/man_html.c 2017/05/04 17:48:28 1.137 +++ mandoc/man_html.c 2017/05/05 13:17:54 1.140 @@ -1,4 +1,4 @@ -/* $Id: man_html.c,v 1.137 2017/05/04 17:48:28 schwarze Exp $ */ +/* $Id: man_html.c,v 1.140 2017/05/05 13:17:54 schwarze Exp $ */ /* * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons * Copyright (c) 2013, 2014, 2015, 2017 Ingo Schwarze @@ -65,11 +65,11 @@ static int man_SM_pre(MAN_ARGS); static int man_SS_pre(MAN_ARGS); static int man_UR_pre(MAN_ARGS); static int man_alt_pre(MAN_ARGS); -static int man_br_pre(MAN_ARGS); static int man_ign_pre(MAN_ARGS); static int man_in_pre(MAN_ARGS); static void man_root_post(MAN_ARGS); static void man_root_pre(MAN_ARGS); +static int man_sp_pre(MAN_ARGS); static const struct htmlman __mans[MAN_MAX - MAN_TH] = { { NULL, NULL }, /* TH */ @@ -92,7 +92,7 @@ static const struct htmlman __mans[MAN_MAX - MAN_TH] = { man_I_pre, NULL }, /* I */ { man_alt_pre, NULL }, /* IR */ { man_alt_pre, NULL }, /* RI */ - { man_br_pre, NULL }, /* sp */ + { man_sp_pre, NULL }, /* sp */ { NULL, NULL }, /* nf */ { NULL, NULL }, /* fi */ { NULL, NULL }, /* RE */ @@ -102,13 +102,11 @@ static const struct htmlman __mans[MAN_MAX - MAN_TH] = { man_ign_pre, NULL }, /* PD */ { man_ign_pre, NULL }, /* AT */ { man_in_pre, NULL }, /* in */ - { man_ign_pre, NULL }, /* ft */ { man_OP_pre, NULL }, /* OP */ { NULL, NULL }, /* EX */ { NULL, NULL }, /* EE */ { man_UR_pre, NULL }, /* UR */ { NULL, NULL }, /* UE */ - { man_ign_pre, NULL }, /* ll */ }; static const struct htmlman *const mans = __mans - MAN_TH; @@ -305,13 +303,7 @@ print_man_node(MAN_ARGS) t = h->tag; if (n->tok < ROFF_MAX) { - switch(n->tok) { - case ROFF_br: - man_br_pre(man, n, h); - break; - default: - abort(); - } + roff_html_pre(h, n); break; } @@ -423,18 +415,14 @@ man_root_post(MAN_ARGS) static int -man_br_pre(MAN_ARGS) +man_sp_pre(MAN_ARGS) { struct roffsu su; SCALE_VS_INIT(&su, 1); - - if (MAN_sp == n->tok) { - if (NULL != (n = n->child)) - if ( ! a2roffsu(n->string, &su, SCALE_VS)) - su.scale = 1.0; - } else - su.scale = 0.0; + if (NULL != (n = n->child)) + if ( ! a2roffsu(n->string, &su, SCALE_VS)) + su.scale = 1.0; print_otag(h, TAG_DIV, "suh", &su);