diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-08-10 14:07:23 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-08-10 14:07:23 +0000 |
commit | ffcddd3ed6e06cc3307b16f844664d242efa178f (patch) | |
tree | 83209630c170e38a82b4e3935010b26c4cf34f60 /mdoc_html.c | |
parent | e393b0f646e06dc74cb0c8a6d9eb2b6665c3fc63 (diff) | |
download | mandoc-ffcddd3ed6e06cc3307b16f844664d242efa178f.tar.gz |
Allow `Sx' and `Ss' to have child nodes. Fixes manuals in NetBSD.
Originally pointed out by joerg@ then again by Thomas Klausner by way of
Nicolas Joy. Note: don't use these constructions as you can't link to
the sections with `Sx'.
Diffstat (limited to 'mdoc_html.c')
-rw-r--r-- | mdoc_html.c | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/mdoc_html.c b/mdoc_html.c index 0317a6ad..85322c73 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -608,18 +608,22 @@ mdoc_sh_pre(MDOC_ARGS) bufinit(h); bufcat(h, "x"); - for (n = n->child; n; n = n->next) { + + for (n = n->child; n && MDOC_TEXT == n->type; ) { bufcat_id(h, n->string); - if (n->next) + if (NULL != (n = n->next)) bufcat_id(h, " "); } - PAIR_ID_INIT(&tag, h->buf); - print_otag(h, TAG_H1, 1, &tag); + if (NULL == n) { + PAIR_ID_INIT(&tag, h->buf); + print_otag(h, TAG_H1, 1, &tag); + } else + print_otag(h, TAG_H1, 0, NULL); + return(1); } - /* ARGSUSED */ static int mdoc_ss_pre(MDOC_ARGS) @@ -635,14 +639,19 @@ mdoc_ss_pre(MDOC_ARGS) bufinit(h); bufcat(h, "x"); - for (n = n->child; n; n = n->next) { + + for (n = n->child; n && MDOC_TEXT == n->type; ) { bufcat_id(h, n->string); - if (n->next) + if (NULL != (n = n->next)) bufcat_id(h, " "); } - PAIR_ID_INIT(&tag, h->buf); - print_otag(h, TAG_H2, 1, &tag); + if (NULL == n) { + PAIR_ID_INIT(&tag, h->buf); + print_otag(h, TAG_H2, 1, &tag); + } else + print_otag(h, TAG_H2, 0, NULL); + return(1); } @@ -1171,9 +1180,10 @@ mdoc_sx_pre(MDOC_ARGS) bufinit(h); bufcat(h, "#x"); - for (n = n->child; n; n = n->next) { + + for (n = n->child; n; ) { bufcat_id(h, n->string); - if (n->next) + if (NULL != (n = n->next)) bufcat_id(h, " "); } |