=================================================================== RCS file: /cvs/mandoc/html.c,v retrieving revision 1.113 retrieving revision 1.118 diff -u -p -r1.113 -r1.118 --- mandoc/html.c 2010/10/01 21:51:13 1.113 +++ mandoc/html.c 2010/12/17 10:37:26 1.118 @@ -1,4 +1,4 @@ -/* $Id: html.c,v 1.113 2010/10/01 21:51:13 schwarze Exp $ */ +/* $Id: html.c,v 1.118 2010/12/17 10:37:26 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * @@ -57,12 +57,19 @@ static const struct htmldata htmltags[TAG_MAX] = { {"br", HTML_CLRLINE | HTML_NOSTACK | HTML_AUTOCLOSE}, /* TAG_BR */ {"a", 0}, /* TAG_A */ {"table", HTML_CLRLINE}, /* TAG_TABLE */ + {"tbody", HTML_CLRLINE}, /* TAG_TBODY */ {"col", HTML_CLRLINE | HTML_NOSTACK | HTML_AUTOCLOSE}, /* TAG_COL */ {"tr", HTML_CLRLINE}, /* TAG_TR */ {"td", HTML_CLRLINE}, /* TAG_TD */ {"li", HTML_CLRLINE}, /* TAG_LI */ {"ul", HTML_CLRLINE}, /* TAG_UL */ {"ol", HTML_CLRLINE}, /* TAG_OL */ + {"dl", HTML_CLRLINE}, /* TAG_DL */ + {"dt", HTML_CLRLINE}, /* TAG_DT */ + {"dd", HTML_CLRLINE}, /* TAG_DD */ + {"blockquote", HTML_CLRLINE}, /* TAG_BLOCKQUOTE */ + {"p", HTML_CLRLINE | HTML_NOSTACK | HTML_AUTOCLOSE}, /* TAG_P */ + {"pre", HTML_CLRLINE }, /* TAG_PRE */ }; static const char *const htmlfonts[HTMLFONT_MAX] = { @@ -121,7 +128,6 @@ ml_alloc(char *outopts, enum htmltype type) h->type = type; h->tags.head = NULL; - h->ords.head = NULL; h->symtab = chars_init(CHARS_HTML); while (outopts && *outopts) @@ -162,16 +168,10 @@ void html_free(void *p) { struct tag *tag; - struct ord *ord; struct html *h; h = (struct html *)p; - while ((ord = h->ords.head) != NULL) { - h->ords.head = ord->next; - free(ord); - } - while ((tag = h->tags.head) != NULL) { h->tags.head = tag->next; free(tag); @@ -450,6 +450,10 @@ print_otag(struct html *h, enum htmltag tag, putchar('>'); h->flags |= HTML_NOSPACE; + + if ((HTML_AUTOCLOSE | HTML_CLRLINE) & htmltags[tag].flags) + putchar('\n'); + return(t); }