=================================================================== RCS file: /cvs/mandoc/mdoc_html.c,v retrieving revision 1.27 retrieving revision 1.34 diff -u -p -r1.27 -r1.34 --- mandoc/mdoc_html.c 2009/10/08 23:00:15 1.27 +++ mandoc/mdoc_html.c 2009/10/19 11:02:24 1.34 @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.27 2009/10/08 23:00:15 kristaps Exp $ */ +/* $Id: mdoc_html.c,v 1.34 2009/10/19 11:02:24 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -29,6 +29,7 @@ #include "out.h" #include "html.h" #include "mdoc.h" +#include "main.h" #define INDENT 5 #define HALFINDENT 3 @@ -326,10 +327,10 @@ static void a2width(const char *p, struct roffsu *su) { - if (a2roffsu(p, su)) - return; - su->unit = SCALE_EM; - su->scale = (int)strlen(p); + if ( ! a2roffsu(p, su, SCALE_MAX)) { + su->unit = SCALE_EM; + su->scale = (int)strlen(p); + } } @@ -342,13 +343,15 @@ static void a2offs(const char *p, struct roffsu *su) { + /* FIXME: "right"? */ + if (0 == strcmp(p, "left")) SCALE_HS_INIT(su, 0); else if (0 == strcmp(p, "indent")) SCALE_HS_INIT(su, INDENT); else if (0 == strcmp(p, "indent-two")) SCALE_HS_INIT(su, INDENT * 2); - else if ( ! a2roffsu(p, su)) { + else if ( ! a2roffsu(p, su, SCALE_MAX)) { su->unit = SCALE_EM; su->scale = (int)strlen(p); } @@ -1065,6 +1068,8 @@ mdoc_it_pre(MDOC_ARGS) /* Override width in some cases. */ switch (type) { + case (MDOC_Item): + /* FALLTHROUGH */ case (MDOC_Inset): /* FALLTHROUGH */ case (MDOC_Diag): @@ -1356,6 +1361,8 @@ mdoc_bd_pre(MDOC_ARGS) case (MDOC_Compact): comp = 1; break; + case (MDOC_Centred): + /* FALLTHROUGH */ case (MDOC_Ragged): /* FALLTHROUGH */ case (MDOC_Filled): @@ -1365,8 +1372,12 @@ mdoc_bd_pre(MDOC_ARGS) case (MDOC_Literal): type = bl->args->argv[i].arg; break; + default: + break; } + /* FIXME: -centered, etc. formatting. */ + if (MDOC_BLOCK == n->type) { bufcat_su(h, "margin-left", &su); for (nn = n; nn && ! comp; nn = nn->parent) { @@ -1455,6 +1466,7 @@ mdoc_cd_pre(MDOC_ARGS) { struct htmlpair tag; + print_otag(h, TAG_DIV, 0, NULL); PAIR_CLASS_INIT(&tag, "config"); print_otag(h, TAG_SPAN, 1, &tag); return(1); @@ -1829,6 +1841,8 @@ mdoc_in_pre(MDOC_ARGS) } else print_otag(h, TAG_DIV, 0, NULL); } + + /* FIXME: there's a buffer bug in here somewhere. */ PAIR_CLASS_INIT(&tag[0], "includes"); print_otag(h, TAG_SPAN, 1, tag);