=================================================================== RCS file: /cvs/mandoc/mdoc_html.c,v retrieving revision 1.84 retrieving revision 1.90 diff -u -p -r1.84 -r1.90 --- mandoc/mdoc_html.c 2010/06/13 21:41:58 1.84 +++ mandoc/mdoc_html.c 2010/07/01 22:56:17 1.90 @@ -1,6 +1,6 @@ -/* $Id: mdoc_html.c,v 1.84 2010/06/13 21:41:58 kristaps Exp $ */ +/* $Id: mdoc_html.c,v 1.90 2010/07/01 22:56:17 kristaps Exp $ */ /* - * Copyright (c) 2008, 2009 Kristaps Dzonsons + * Copyright (c) 2008, 2009 Kristaps Dzonsons * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -30,6 +30,7 @@ #include "mandoc.h" #include "out.h" #include "html.h" +#include "regs.h" #include "mdoc.h" #include "main.h" @@ -303,7 +304,7 @@ synopsis_pre(struct html *h, const struct mdoc_node *n struct roffsu su; struct htmlpair tag; - if (NULL == n->prev || SEC_SYNOPSIS != n->sec) + if (NULL == n->prev || ! (MDOC_SYNPRETTY & n->flags)) return; SCALE_VS_INIT(&su, 1); @@ -436,7 +437,7 @@ print_mdoc_node(MDOC_ARGS) print_text(h, n->string); return; default: - if (mdocs[n->tok].pre) + if (mdocs[n->tok].pre && ENDBODY_NOT == n->end) child = (*mdocs[n->tok].pre)(m, n, h); break; } @@ -452,7 +453,7 @@ print_mdoc_node(MDOC_ARGS) mdoc_root_post(m, n, h); break; default: - if (mdocs[n->tok].post) + if (mdocs[n->tok].post && ENDBODY_NOT == n->end) (*mdocs[n->tok].post)(m, n, h); break; } @@ -1037,11 +1038,12 @@ mdoc_it_pre(MDOC_ARGS) SCALE_HS_INIT(&offs, 0); - type = bl->data.Bl.type; - comp = bl->data.Bl.comp; + assert(bl->data.Bl); + type = bl->data.Bl->type; + comp = bl->data.Bl->comp; - if (bl->data.Bl.offs) - a2offs(bl->data.Bl.offs, &offs); + if (bl->data.Bl->offs) + a2offs(bl->data.Bl->offs, &offs); switch (type) { case (LIST_enum): @@ -1058,8 +1060,8 @@ mdoc_it_pre(MDOC_ARGS) break; } - if (bl->data.Bl.width) - a2width(bl->data.Bl.width, &width); + if (bl->data.Bl->width) + a2width(bl->data.Bl->width, &width); wp = -1; for (i = 0; bl->args && i < (int)bl->args->argc; i++) @@ -1117,7 +1119,8 @@ mdoc_bl_pre(MDOC_ARGS) return(0); if (MDOC_BLOCK != n->type) return(1); - if (LIST_enum != n->data.Bl.type) + assert(n->data.Bl); + if (LIST_enum != n->data.Bl->type) return(1); ord = malloc(sizeof(struct ord)); @@ -1141,7 +1144,7 @@ mdoc_bl_post(MDOC_ARGS) if (MDOC_BLOCK != n->type) return; - if (LIST_enum != n->data.Bl.type) + if (LIST_enum != n->data.Bl->type) return; ord = h->ords.head; @@ -1356,10 +1359,11 @@ mdoc_bd_pre(MDOC_ARGS) SCALE_VS_INIT(&su, 0); - if (n->data.Bd.offs) - a2offs(n->data.Bd.offs, &su); + assert(n->data.Bd); + if (n->data.Bd->offs) + a2offs(n->data.Bd->offs, &su); - comp = n->data.Bd.comp; + comp = n->data.Bd->comp; /* FIXME: -centered, etc. formatting. */ /* FIXME: does not respect -offset ??? */ @@ -1386,8 +1390,8 @@ mdoc_bd_pre(MDOC_ARGS) return(1); } - if (DISP_unfilled != n->data.Bd.type && - DISP_literal != n->data.Bd.type) + if (DISP_unfilled != n->data.Bd->type && + DISP_literal != n->data.Bd->type) return(1); PAIR_CLASS_INIT(&tag[0], "lit"); @@ -1613,7 +1617,7 @@ mdoc_fn_pre(MDOC_ARGS) */ #if 0 - if (SEC_SYNOPSIS == n->sec) { + if (MDOC_SYNPRETTY & n->flags) { nbuf[0] = '\0'; html_idcat(nbuf, sp, BUFSIZ); PAIR_ID_INIT(&tag[1], nbuf); @@ -1643,7 +1647,7 @@ mdoc_fn_pre(MDOC_ARGS) for (nn = n->child->next; nn; nn = nn->next) { i = 1; - if (SEC_SYNOPSIS == n->sec) + if (MDOC_SYNPRETTY & n->flags) i = 2; t = print_otag(h, TAG_SPAN, i, tag); print_text(h, nn->string); @@ -1653,7 +1657,7 @@ mdoc_fn_pre(MDOC_ARGS) } print_text(h, ")"); - if (SEC_SYNOPSIS == n->sec) + if (MDOC_SYNPRETTY & n->flags) print_text(h, ";"); return(0); @@ -1823,7 +1827,7 @@ mdoc_in_pre(MDOC_ARGS) PAIR_CLASS_INIT(&tag[0], "includes"); print_otag(h, TAG_SPAN, 1, tag); - if (SEC_SYNOPSIS == n->sec && MDOC_LINE & n->flags) + if (MDOC_SYNPRETTY & n->flags && MDOC_LINE & n->flags) print_text(h, "#include"); print_text(h, "<");