=================================================================== RCS file: /cvs/mandoc/man_html.c,v retrieving revision 1.171 retrieving revision 1.172 diff -u -p -r1.171 -r1.172 --- mandoc/man_html.c 2019/02/28 16:36:13 1.171 +++ mandoc/man_html.c 2019/03/01 10:57:18 1.172 @@ -1,4 +1,4 @@ -/* $Id: man_html.c,v 1.171 2019/02/28 16:36:13 schwarze Exp $ */ +/* $Id: man_html.c,v 1.172 2019/03/01 10:57:18 schwarze Exp $ */ /* * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons * Copyright (c) 2013-2015, 2017-2019 Ingo Schwarze @@ -310,18 +310,25 @@ man_root_post(const struct roff_meta *man, struct html static int man_SH_pre(MAN_ARGS) { - char *id; + const char *class; + char *id; + enum htmltag tag; + if (n->tok == MAN_SH) { + tag = TAG_H1; + class = "Sh"; + } else { + tag = TAG_H2; + class = "Ss"; + } switch (n->type) { case ROFFT_BLOCK: html_close_paragraph(h); + print_otag(h, TAG_SECTION, "c", class); break; case ROFFT_HEAD: id = html_make_id(n, 1); - if (n->tok == MAN_SH) - print_otag(h, TAG_H1, "ci", "Sh", id); - else - print_otag(h, TAG_H2, "ci", "Ss", id); + print_otag(h, tag, "ci", class, id); if (id != NULL) print_otag(h, TAG_A, "chR", "permalink", id); break;