=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mdoc_html.c,v retrieving revision 1.5 retrieving revision 1.6 diff -c -r1.5 -r1.6 *** src/usr.bin/mandoc/mdoc_html.c 2009/12/24 02:08:14 1.5 --- src/usr.bin/mandoc/mdoc_html.c 2010/01/02 02:42:06 1.6 *************** *** 1,4 **** ! /* $Id: mdoc_html.c,v 1.5 2009/12/24 02:08:14 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * --- 1,4 ---- ! /* $Id: mdoc_html.c,v 1.6 2010/01/02 02:42:06 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * *************** *** 15,21 **** * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include - #include #include #include --- 15,20 ---- *************** *** 36,41 **** --- 35,44 ---- const struct mdoc_node *n, \ struct html *h + #ifndef MIN + #define MIN(a,b) ((/*CONSTCOND*/(a)<(b))?(a):(b)) + #endif + struct htmlmdoc { int (*pre)(MDOC_ARGS); void (*post)(MDOC_ARGS); *************** *** 656,665 **** PAIR_CLASS_INIT(&tag, "flag"); print_otag(h, TAG_SPAN, 1, &tag); ! if (MDOC_Fl == n->tok) { ! print_text(h, "\\-"); h->flags |= HTML_NOSPACE; ! } return(1); } --- 659,677 ---- PAIR_CLASS_INIT(&tag, "flag"); print_otag(h, TAG_SPAN, 1, &tag); ! ! /* `Cm' has no leading hyphen. */ ! ! if (MDOC_Cm == n->tok) ! return(1); ! ! print_text(h, "\\-"); ! ! /* A blank `Fl' should incur a subsequent space. */ ! ! if (n->child) h->flags |= HTML_NOSPACE; ! return(1); } *************** *** 1568,1576 **** struct roffsu su; if (SEC_SYNOPSIS == n->sec) { ! if (n->next && MDOC_Vt != n->next->tok) { SCALE_VS_INIT(&su, 1); ! bufcat_su(h, "margin-bottom", &su); PAIR_STYLE_INIT(&tag, h); print_otag(h, TAG_DIV, 1, &tag); } else --- 1580,1588 ---- struct roffsu su; if (SEC_SYNOPSIS == n->sec) { ! if (n->prev && MDOC_Vt != n->prev->tok) { SCALE_VS_INIT(&su, 1); ! bufcat_su(h, "margin-top", &su); PAIR_STYLE_INIT(&tag, h); print_otag(h, TAG_DIV, 1, &tag); } else