=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mdoc_html.c,v retrieving revision 1.47 retrieving revision 1.48 diff -c -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 **** ! /* $Id: mdoc_html.c,v 1.47 2011/01/16 02:56:47 schwarze Exp $ */ /* ! * Copyright (c) 2008, 2009, 2010 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 --- 1,6 ---- ! /* $Id: mdoc_html.c,v 1.48 2011/01/16 19:41:16 schwarze Exp $ */ /* ! * 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,429 **** child = mdoc_root_pre(m, n, h); break; case (MDOC_TEXT): if (' ' == *n->string && MDOC_LINE & n->flags) print_otag(h, TAG_BR, 0, NULL); print_text(h, n->string); return; case (MDOC_TBL): print_tbl(h, n->span); ! break; default: if (mdocs[n->tok].pre && ENDBODY_NOT == n->end) child = (*mdocs[n->tok].pre)(m, n, h); break; --- 416,447 ---- 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); ! 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,457 **** 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) --- 468,473 ----