-/* $Id: mdoc_html.c,v 1.100 2010/07/27 08:38:04 kristaps Exp $ */
+/* $Id: mdoc_html.c,v 1.104 2010/09/04 20:18:53 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
*
ord = malloc(sizeof(struct ord));
if (NULL == ord) {
perror(NULL);
- exit(EXIT_FAILURE);
+ exit((int)MANDOCLEVEL_SYSERR);
}
ord->cookie = n;
ord->pos = 1;
print_otag(h, TAG_DIV, 2, tag);
for (nn = n->child; nn; nn = nn->next) {
- if (nn->prev && nn->prev->line < nn->line) {
- print_text(h, "\n");
- h->flags |= HTML_NOSPACE;
- }
print_mdoc_node(m, nn, h);
+ if (nn->next && nn->next->line == nn->line)
+ continue;
+ print_text(h, "\n");
+ h->flags |= HTML_NOSPACE;
}
return(0);
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");
PAIR_HREF_INIT(&tag[1], n->child->string);
print_otag(h, TAG_A, 2, tag);
+
return(1);
}
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;