=================================================================== RCS file: /cvs/mandoc/html.c,v retrieving revision 1.258 retrieving revision 1.259 diff -u -p -r1.258 -r1.259 --- mandoc/html.c 2019/09/01 15:12:19 1.258 +++ mandoc/html.c 2019/09/03 12:31:05 1.259 @@ -1,4 +1,4 @@ -/* $Id: html.c,v 1.258 2019/09/01 15:12:19 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 @@ -271,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; } }