summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2018-10-04 13:23:04 +0000
committerIngo Schwarze <schwarze@openbsd.org>2018-10-04 13:23:04 +0000
commitdc48ebec7e316826f641d93e25ca90eb1929295a (patch)
treecee70019b30e9bcc95fc3999902dc050a61d797e
parentac3e64d4a46ee1fee8c38f160260efffe5a64a3e (diff)
downloadmandoc-dc48ebec7e316826f641d93e25ca90eb1929295a.tar.gz
When a subsection header contains no letters but only special
characters, skip the TOC entry. Issue reported by kristaps@.
-rw-r--r--mdoc_html.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mdoc_html.c b/mdoc_html.c
index d9976f12..073aee35 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -541,11 +541,13 @@ mdoc_sh_pre(MDOC_ARGS)
subn = subn->next) {
if (subn->tok != MDOC_Ss)
continue;
+ id = html_make_id(subn->head, 0);
+ if (id == NULL)
+ continue;
if (tsub == NULL)
print_otag(h, TAG_UL,
"c", "Bl-compact");
tsub = print_otag(h, TAG_LI, "");
- id = html_make_id(subn->head, 0);
print_otag(h, TAG_A, "hR", id);
free(id);
print_mdoc_nodelist(meta,