diff options
author | 2010-09-04 19:01:52 +0000 | |
---|---|---|
committer | 2010-09-04 19:01:52 +0000 | |
commit | e34eebeaa729c7d5cc258b87d5a6edd409cfaea2 (patch) | |
tree | e7ce81f41c55fcbeddff137f27cc0aaaf7542a3a /mdoc_html.c | |
parent | 0fa73731889c2ae8170a8e5d38b5023ff6c6f321 (diff) | |
download | mandoc-e34eebeaa729c7d5cc258b87d5a6edd409cfaea2.tar.gz mandoc-e34eebeaa729c7d5cc258b87d5a6edd409cfaea2.tar.zst mandoc-e34eebeaa729c7d5cc258b87d5a6edd409cfaea2.zip |
Properly handle -mdoc %A in all outputs. This has two-author entires
separated by only "and" while two or more are with ", and" for the last
author.
Also remove relevant TODO and add regression tests.
Diffstat (limited to 'mdoc_html.c')
-rw-r--r-- | mdoc_html.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/mdoc_html.c b/mdoc_html.c index 1ee5c076..59be4e98 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.102 2010/08/20 01:02:07 schwarze Exp $ */ +/* $Id: mdoc_html.c,v 1.103 2010/09/04 19:01:52 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -2194,6 +2194,9 @@ mdoc__x_pre(MDOC_ARGS) switch (n->tok) { case(MDOC__A): PAIR_CLASS_INIT(&tag[0], "ref-auth"); + if (n->prev && MDOC__A == n->prev->tok) + if (NULL == n->next || MDOC__A != n->next->tok) + print_text(h, "and"); break; case(MDOC__B): PAIR_CLASS_INIT(&tag[0], "ref-book"); @@ -2246,6 +2249,7 @@ mdoc__x_pre(MDOC_ARGS) PAIR_HREF_INIT(&tag[1], n->child->string); print_otag(h, TAG_A, 2, tag); + return(1); } @@ -2255,6 +2259,11 @@ static void mdoc__x_post(MDOC_ARGS) { + if (MDOC__A == n->tok && n->next && MDOC__A == n->next->tok) + if (NULL == n->next->next || MDOC__A != n->next->next->tok) + if (NULL == n->prev || MDOC__A != n->prev->tok) + return; + /* TODO: %U */ h->flags |= HTML_NOSPACE; |