From: schwarze Date: Wed, 18 Oct 2023 16:11:29 +0000 (+0000) Subject: Support the GNU-specific syntax ".IP \\[bu]" for bullet lists in man(7) X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0f7f2ebbd1123543ce046497a2d91b4b79a8efcb;p=openbsd Support the GNU-specific syntax ".IP \\[bu]" for bullet lists in man(7) pages that Alejandro Colomar recommends in the "Lists" subsection of https://man7.org/linux/man-pages/man7/man-pages.7.html#STYLE_GUIDE . For example, this will improve HTML formatting of the first list in the subsection "Feature test macros understood by glibc" on the page https://manpages.debian.org/bookworm/manpages/ftm.7.en.html . Issue reported by Alejandro Colomar . --- diff --git a/usr.bin/mandoc/man_html.c b/usr.bin/mandoc/man_html.c index 5e0bffebd53..581f837255a 100644 --- a/usr.bin/mandoc/man_html.c +++ b/usr.bin/mandoc/man_html.c @@ -1,4 +1,4 @@ -/* $OpenBSD: man_html.c,v 1.138 2023/04/28 20:14:19 schwarze Exp $ */ +/* $OpenBSD: man_html.c,v 1.139 2023/10/18 16:11:29 schwarze Exp $ */ /* * Copyright (c) 2013-2015,2017-2020,2022 Ingo Schwarze * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons @@ -431,10 +431,12 @@ list_continues(const struct roff_node *n1, const struct roff_node *n2) s2 = n2 == NULL ? "" : n2->string; c1 = strcmp(s1, "*") == 0 ? '*' : strcmp(s1, "\\-") == 0 ? '-' : - strcmp(s1, "\\(bu") == 0 ? 'b' : ' '; + strcmp(s1, "\\(bu") == 0 ? 'b' : + strcmp(s1, "\\[bu]") == 0 ? 'b' : ' '; c2 = strcmp(s2, "*") == 0 ? '*' : strcmp(s2, "\\-") == 0 ? '-' : - strcmp(s2, "\\(bu") == 0 ? 'b' : ' '; + strcmp(s2, "\\(bu") == 0 ? 'b' : + strcmp(s2, "\\[bu]") == 0 ? 'b' : ' '; return c1 != c2 ? '\0' : c1 == 'b' ? '*' : c1; }