=================================================================== RCS file: /cvs/mandoc/html.c,v retrieving revision 1.257 retrieving revision 1.259 diff -u -p -r1.257 -r1.259 --- mandoc/html.c 2019/08/29 17:57:29 1.257 +++ mandoc/html.c 2019/09/03 12:31:05 1.259 @@ -1,4 +1,4 @@ -/* $Id: html.c,v 1.257 2019/08/29 17:57:29 schwarze Exp $ */ +/* $Id: html.c,v 1.259 2019/09/03 12:31:05 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2011-2015, 2017-2019 Ingo Schwarze @@ -65,7 +65,6 @@ static const struct htmldata htmltags[TAG_MAX] = { {"title", HTML_NLAROUND}, {"body", HTML_NLALL}, {"div", HTML_NLAROUND}, - {"div", 0}, {"section", HTML_NLALL}, {"table", HTML_NLALL | HTML_INDENT}, {"tr", HTML_NLALL | HTML_INDENT}, @@ -272,21 +271,18 @@ print_metaf(struct html *h) void html_close_paragraph(struct html *h) { - struct tag *t; + struct tag *this, *next; + int flags; - for (t = h->tag; t != NULL && t->closed == 0; t = t->next) { - switch(t->tag) { - case TAG_P: - case TAG_PRE: - print_tagq(h, t); + this = h->tag; + for (;;) { + next = this->next; + flags = htmltags[this->tag].flags; + if (flags & (HTML_INPHRASE | HTML_TOPHRASE)) + print_ctag(h, this); + if ((flags & HTML_INPHRASE) == 0) break; - case TAG_A: - print_tagq(h, t); - continue; - default: - continue; - } - break; + this = next; } }