From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id a06aa99a for ; Thu, 28 Feb 2019 11:36:43 -0500 (EST) Date: Thu, 28 Feb 2019 11:36:43 -0500 (EST) X-Mailinglist: mandoc-source Reply-To: source@mandoc.bsd.lv MIME-Version: 1.0 From: schwarze@mandoc.bsd.lv To: source@mandoc.bsd.lv Subject: mandoc: Format multiple subsequent .IP or multiple subsequent .TP/.TQ as X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Message-ID: Log Message: ----------- Format multiple subsequent .IP or multiple subsequent .TP/.TQ as a single
list rather than opening a new list for each item; feature suggested by Pali dot Rohar at gmail dot com. Modified Files: -------------- mandoc: TODO man_html.c Revision Data ------------- Index: man_html.c =================================================================== RCS file: /home/cvs/mandoc/mandoc/man_html.c,v retrieving revision 1.170 retrieving revision 1.171 diff -Lman_html.c -Lman_html.c -u -p -r1.170 -r1.171 --- man_html.c +++ man_html.c @@ -233,7 +233,25 @@ print_man_node(MAN_ARGS) /* This will automatically close out any font scope. */ t->refcnt--; - print_stagq(h, t); + if (n->type == ROFFT_BLOCK && + (n->tok == MAN_IP || n->tok == MAN_TP || n->tok == MAN_TQ)) { + t = h->tag; + while (t->tag != TAG_DL) + t = t->next; + /* + * Close the list if no further item of the same type + * follows; otherwise, close the item only. + */ + if (n->next == NULL || + (n->tok == MAN_IP && n->next->tok != MAN_IP) || + (n->tok != MAN_IP && + n->next->tok != MAN_TP && n->next->tok != MAN_TQ)) { + print_tagq(h, t); + t = NULL; + } + } + if (t != NULL) + print_stagq(h, t); if (n->flags & NODE_NOFILL && n->tok != MAN_YS && (n->next != NULL && n->next->flags & NODE_LINE)) { @@ -399,7 +417,15 @@ man_IP_pre(MAN_ARGS) switch (n->type) { case ROFFT_BLOCK: html_close_paragraph(h); - print_otag(h, TAG_DL, "c", "Bl-tag"); + /* + * Open a new list unless there is an immediately + * preceding item of the same type. + */ + if (n->prev == NULL || + (n->tok == MAN_IP && n->prev->tok != MAN_IP) || + (n->tok != MAN_IP && + n->prev->tok != MAN_TP && n->prev->tok != MAN_TQ)) + print_otag(h, TAG_DL, "c", "Bl-tag"); return 1; case ROFFT_HEAD: print_otag(h, TAG_DT, ""); Index: TODO =================================================================== RCS file: /home/cvs/mandoc/mandoc/TODO,v retrieving revision 1.283 retrieving revision 1.284 diff -LTODO -LTODO -u -p -r1.283 -r1.284 --- TODO +++ TODO @@ -349,11 +349,6 @@ are mere guesses, and some may be wrong. it does seem cleaner.) loc ** exist ** algo * size * imp *** -- format multiple subsequent .IP as a single list - rather than opening a new list for each item - Pali Rohar 25 Nov 2018 14:34:26 +0100 - loc * exist ** algo * size * imp *** - - format ".IP *" etc. as
    rather than
    https://github.com/Debian/debiman/issues/67 reminded by Pali Rohar 25 Nov 2018 14:34:26 +0100 -- To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv