=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mdoc_html.c,v retrieving revision 1.47 retrieving revision 1.48 diff -u -r1.47 -r1.48 --- src/usr.bin/mandoc/mdoc_html.c 2011/01/16 02:56:47 1.47 +++ src/usr.bin/mandoc/mdoc_html.c 2011/01/16 19:41:16 1.48 @@ -1,6 +1,6 @@ -/* $Id: mdoc_html.c,v 1.47 2011/01/16 02:56:47 schwarze Exp $ */ +/* $Id: mdoc_html.c,v 1.48 2011/01/16 19:41:16 schwarze Exp $ */ /* - * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons + * Copyright (c) 2008, 2009, 2010, 2011 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 @@ -416,14 +416,32 @@ child = mdoc_root_pre(m, n, h); break; case (MDOC_TEXT): + /* No tables in this mode... */ + assert(NULL == h->tblt); if (' ' == *n->string && MDOC_LINE & n->flags) print_otag(h, TAG_BR, 0, NULL); print_text(h, n->string); return; case (MDOC_TBL): + /* + * This will take care of initialising all of the table + * state data for the first table, then tearing it down + * for the last one. + */ print_tbl(h, n->span); - break; + return; default: + /* + * Close out the current table, if it's open, and unset + * the "meta" table state. This will be reopened on the + * next table element. + */ + if (h->tblt) { + print_tblclose(h); + t = h->tags.head; + } + + assert(NULL == h->tblt); if (mdocs[n->tok].pre && ENDBODY_NOT == n->end) child = (*mdocs[n->tok].pre)(m, n, h); break; @@ -450,8 +468,6 @@ switch (n->type) { case (MDOC_ROOT): mdoc_root_post(m, n, h); - break; - case (MDOC_TBL): break; default: if (mdocs[n->tok].post && ENDBODY_NOT == n->end)