version 1.42, 2009/10/28 08:00:18 |
version 1.50, 2010/01/01 13:17:58 |
|
|
|
|
#include <assert.h> |
#include <assert.h> |
#include <ctype.h> |
#include <ctype.h> |
#include <err.h> |
|
#include <stdio.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdlib.h> |
#include <string.h> |
#include <string.h> |
Line 425 print_mdoc_node(MDOC_ARGS) |
|
Line 424 print_mdoc_node(MDOC_ARGS) |
|
break; |
break; |
case (MDOC_TEXT): |
case (MDOC_TEXT): |
print_text(h, n->string); |
print_text(h, n->string); |
break; |
return; |
default: |
default: |
if (mdocs[n->tok].pre) |
if (mdocs[n->tok].pre) |
child = (*mdocs[n->tok].pre)(m, n, h); |
child = (*mdocs[n->tok].pre)(m, n, h); |
Line 442 print_mdoc_node(MDOC_ARGS) |
|
Line 441 print_mdoc_node(MDOC_ARGS) |
|
case (MDOC_ROOT): |
case (MDOC_ROOT): |
mdoc_root_post(m, n, h); |
mdoc_root_post(m, n, h); |
break; |
break; |
case (MDOC_TEXT): |
|
break; |
|
default: |
default: |
if (mdocs[n->tok].post) |
if (mdocs[n->tok].post) |
(*mdocs[n->tok].post)(m, n, h); |
(*mdocs[n->tok].post)(m, n, h); |
Line 662 mdoc_fl_pre(MDOC_ARGS) |
|
Line 659 mdoc_fl_pre(MDOC_ARGS) |
|
{ |
{ |
struct htmlpair tag; |
struct htmlpair tag; |
|
|
|
/* `Cm' has no leading hyphen. */ |
|
|
|
if (MDOC_Cm == n->tok) { |
|
PAIR_CLASS_INIT(&tag, "flag"); |
|
print_otag(h, TAG_SPAN, 1, &tag); |
|
return(1); |
|
} |
|
|
|
/* A zero-length child shouldn't get a dash. */ |
|
|
|
if (n->child) { |
|
assert(MDOC_TEXT == n->child->type); |
|
assert(n->child->string); |
|
if ('\0' == *n->child->string) |
|
return(0); |
|
} |
|
|
PAIR_CLASS_INIT(&tag, "flag"); |
PAIR_CLASS_INIT(&tag, "flag"); |
print_otag(h, TAG_SPAN, 1, &tag); |
print_otag(h, TAG_SPAN, 1, &tag); |
if (MDOC_Fl == n->tok) { |
|
print_text(h, "\\-"); |
print_text(h, "\\-"); |
|
|
|
/* A blank `Fl' should incur a subsequent space. */ |
|
|
|
if (n->child) |
h->flags |= HTML_NOSPACE; |
h->flags |= HTML_NOSPACE; |
} |
|
return(1); |
return(1); |
} |
} |
|
|
Line 726 mdoc_nm_pre(MDOC_ARGS) |
|
Line 744 mdoc_nm_pre(MDOC_ARGS) |
|
{ |
{ |
struct htmlpair tag; |
struct htmlpair tag; |
|
|
if ( ! (HTML_NEWLINE & h->flags)) |
if (SEC_SYNOPSIS == n->sec && n->prev) { |
if (SEC_SYNOPSIS == n->sec) { |
bufcat_style(h, "clear", "both"); |
bufcat_style(h, "clear", "both"); |
PAIR_STYLE_INIT(&tag, h); |
PAIR_STYLE_INIT(&tag, h); |
print_otag(h, TAG_BR, 1, &tag); |
print_otag(h, TAG_BR, 1, &tag); |
} |
} |
|
|
|
PAIR_CLASS_INIT(&tag, "name"); |
PAIR_CLASS_INIT(&tag, "name"); |
print_otag(h, TAG_SPAN, 1, &tag); |
print_otag(h, TAG_SPAN, 1, &tag); |
Line 811 mdoc_xx_pre(MDOC_ARGS) |
|
Line 828 mdoc_xx_pre(MDOC_ARGS) |
|
pp = "BSDI BSD/OS"; |
pp = "BSDI BSD/OS"; |
break; |
break; |
case (MDOC_Dx): |
case (MDOC_Dx): |
pp = "DragonFlyBSD"; |
pp = "DragonFly"; |
break; |
break; |
case (MDOC_Fx): |
case (MDOC_Fx): |
pp = "FreeBSD"; |
pp = "FreeBSD"; |
Line 952 mdoc_it_head_pre(MDOC_ARGS, int type, struct roffsu *w |
|
Line 969 mdoc_it_head_pre(MDOC_ARGS, int type, struct roffsu *w |
|
|
|
switch (type) { |
switch (type) { |
case (MDOC_Item): |
case (MDOC_Item): |
/* FALLTHROUGH */ |
|
case (MDOC_Ohang): |
|
return(0); |
return(0); |
|
case (MDOC_Ohang): |
|
print_otag(h, TAG_DIV, 0, &tag); |
|
return(1); |
case (MDOC_Column): |
case (MDOC_Column): |
bufcat_su(h, "min-width", width); |
bufcat_su(h, "min-width", width); |
bufcat_style(h, "clear", "none"); |
bufcat_style(h, "clear", "none"); |
Line 1068 mdoc_it_pre(MDOC_ARGS) |
|
Line 1086 mdoc_it_pre(MDOC_ARGS) |
|
/* Override width in some cases. */ |
/* Override width in some cases. */ |
|
|
switch (type) { |
switch (type) { |
|
case (MDOC_Ohang): |
|
/* FALLTHROUGH */ |
case (MDOC_Item): |
case (MDOC_Item): |
/* FALLTHROUGH */ |
/* FALLTHROUGH */ |
case (MDOC_Inset): |
case (MDOC_Inset): |
Line 1115 mdoc_bl_pre(MDOC_ARGS) |
|
Line 1135 mdoc_bl_pre(MDOC_ARGS) |
|
return(1); |
return(1); |
|
|
ord = malloc(sizeof(struct ord)); |
ord = malloc(sizeof(struct ord)); |
if (NULL == ord) |
if (NULL == ord) { |
err(EXIT_FAILURE, "malloc"); |
perror(NULL); |
|
exit(EXIT_FAILURE); |
|
} |
ord->cookie = n; |
ord->cookie = n; |
ord->pos = 1; |
ord->pos = 1; |
ord->next = h->ords.head; |
ord->next = h->ords.head; |
Line 1572 mdoc_vt_pre(MDOC_ARGS) |
|
Line 1594 mdoc_vt_pre(MDOC_ARGS) |
|
struct roffsu su; |
struct roffsu su; |
|
|
if (SEC_SYNOPSIS == n->sec) { |
if (SEC_SYNOPSIS == n->sec) { |
if (n->next && MDOC_Vt != n->next->tok) { |
if (n->prev && MDOC_Vt != n->prev->tok) { |
SCALE_VS_INIT(&su, 1); |
SCALE_VS_INIT(&su, 1); |
bufcat_su(h, "margin-bottom", &su); |
bufcat_su(h, "margin-top", &su); |
PAIR_STYLE_INIT(&tag, h); |
PAIR_STYLE_INIT(&tag, h); |
print_otag(h, TAG_DIV, 1, &tag); |
print_otag(h, TAG_DIV, 1, &tag); |
} else |
} else |