=================================================================== RCS file: /cvs/mandoc/mdoc_html.c,v retrieving revision 1.97 retrieving revision 1.100 diff -u -p -r1.97 -r1.100 --- mandoc/mdoc_html.c 2010/07/19 11:06:31 1.97 +++ mandoc/mdoc_html.c 2010/07/27 08:38:04 1.100 @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.97 2010/07/19 11:06:31 kristaps Exp $ */ +/* $Id: mdoc_html.c,v 1.100 2010/07/27 08:38:04 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * @@ -125,6 +125,7 @@ static int mdoc_pq_pre(MDOC_ARGS); static int mdoc_rs_pre(MDOC_ARGS); static int mdoc_rv_pre(MDOC_ARGS); static int mdoc_sh_pre(MDOC_ARGS); +static int mdoc_sm_pre(MDOC_ARGS); static int mdoc_sp_pre(MDOC_ARGS); static void mdoc_sq_post(MDOC_ARGS); static int mdoc_sq_pre(MDOC_ARGS); @@ -209,7 +210,7 @@ static const struct htmlmdoc mdocs[MDOC_MAX] = { {mdoc_em_pre, NULL}, /* Em */ {NULL, NULL}, /* Eo */ {mdoc_xx_pre, NULL}, /* Fx */ - {mdoc_ms_pre, NULL}, /* Ms */ /* FIXME: convert to symbol? */ + {mdoc_ms_pre, NULL}, /* Ms */ {NULL, NULL}, /* No */ {mdoc_ns_pre, NULL}, /* Ns */ {mdoc_xx_pre, NULL}, /* Nx */ @@ -227,7 +228,7 @@ static const struct htmlmdoc mdocs[MDOC_MAX] = { {NULL, NULL}, /* Sc */ {mdoc_sq_pre, mdoc_sq_post}, /* So */ {mdoc_sq_pre, mdoc_sq_post}, /* Sq */ - {NULL, NULL}, /* Sm */ /* FIXME - no idea. */ + {mdoc_sm_pre, NULL}, /* Sm */ {mdoc_sx_pre, NULL}, /* Sx */ {mdoc_sy_pre, NULL}, /* Sy */ {NULL, NULL}, /* Tn */ @@ -1456,14 +1457,11 @@ mdoc_bd_pre(MDOC_ARGS) print_otag(h, TAG_DIV, 2, tag); for (nn = n->child; nn; nn = nn->next) { - h->flags |= HTML_NOSPACE; - print_mdoc_node(m, nn, h); - if (NULL == nn->next) - continue; - if (nn->prev && nn->prev->line < nn->line) + if (nn->prev && nn->prev->line < nn->line) { print_text(h, "\n"); - else if (NULL == nn->prev) - print_text(h, "\n"); + h->flags |= HTML_NOSPACE; + } + print_mdoc_node(m, nn, h); } return(0); @@ -1715,6 +1713,23 @@ mdoc_fn_pre(MDOC_ARGS) print_text(h, ")"); if (MDOC_SYNPRETTY & n->flags) print_text(h, ";"); + + 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... */ + h->flags &= ~HTML_NOSPACE; + h->flags &= ~HTML_NONOSPACE; + } else + h->flags |= HTML_NONOSPACE; return(0); }