version 1.143, 2011/01/12 10:43:22 |
version 1.151, 2011/02/06 21:44:36 |
Line 420 print_mdoc_node(MDOC_ARGS) |
|
Line 420 print_mdoc_node(MDOC_ARGS) |
|
child = mdoc_root_pre(m, n, h); |
child = mdoc_root_pre(m, n, h); |
break; |
break; |
case (MDOC_TEXT): |
case (MDOC_TEXT): |
|
/* No tables in this mode... */ |
|
assert(NULL == h->tblt); |
|
|
|
/* |
|
* Make sure that if we're in a literal mode already |
|
* (i.e., within a <PRE>) don't print the newline. |
|
*/ |
if (' ' == *n->string && MDOC_LINE & n->flags) |
if (' ' == *n->string && MDOC_LINE & n->flags) |
print_otag(h, TAG_BR, 0, NULL); |
if ( ! (HTML_LITERAL & h->flags)) |
|
print_otag(h, TAG_BR, 0, NULL); |
print_text(h, n->string); |
print_text(h, n->string); |
return; |
return; |
|
case (MDOC_EQN): |
|
return; |
case (MDOC_TBL): |
case (MDOC_TBL): |
|
/* |
|
* This will take care of initialising all of the table |
|
* state data for the first table, then tearing it down |
|
* for the last one. |
|
*/ |
print_tbl(h, n->span); |
print_tbl(h, n->span); |
break; |
return; |
default: |
default: |
|
/* |
|
* Close out the current table, if it's open, and unset |
|
* the "meta" table state. This will be reopened on the |
|
* next table element. |
|
*/ |
|
if (h->tblt) { |
|
print_tblclose(h); |
|
t = h->tags.head; |
|
} |
|
|
|
assert(NULL == h->tblt); |
if (mdocs[n->tok].pre && ENDBODY_NOT == n->end) |
if (mdocs[n->tok].pre && ENDBODY_NOT == n->end) |
child = (*mdocs[n->tok].pre)(m, n, h); |
child = (*mdocs[n->tok].pre)(m, n, h); |
break; |
break; |
Line 455 print_mdoc_node(MDOC_ARGS) |
|
Line 481 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_TBL): |
|
break; |
|
default: |
default: |
if (mdocs[n->tok].post && ENDBODY_NOT == n->end) |
if (mdocs[n->tok].post && ENDBODY_NOT == n->end) |
(*mdocs[n->tok].post)(m, n, h); |
(*mdocs[n->tok].post)(m, n, h); |
|
|
mdoc_ns_pre(MDOC_ARGS) |
mdoc_ns_pre(MDOC_ARGS) |
{ |
{ |
|
|
h->flags |= HTML_NOSPACE; |
if ( ! (MDOC_LINE & n->flags)) |
|
h->flags |= HTML_NOSPACE; |
return(1); |
return(1); |
} |
} |
|
|
Line 807 mdoc_xx_pre(MDOC_ARGS) |
|
Line 832 mdoc_xx_pre(MDOC_ARGS) |
|
|
|
PAIR_CLASS_INIT(&tag, "unix"); |
PAIR_CLASS_INIT(&tag, "unix"); |
print_otag(h, TAG_SPAN, 1, &tag); |
print_otag(h, TAG_SPAN, 1, &tag); |
|
|
print_text(h, pp); |
print_text(h, pp); |
return(1); |
if (n->child) { |
|
h->flags |= HTML_KEEP; |
|
print_text(h, n->child->string); |
|
h->flags &= ~HTML_KEEP; |
|
} |
|
return(0); |
} |
} |
|
|
|
|
Line 816 mdoc_xx_pre(MDOC_ARGS) |
|
Line 847 mdoc_xx_pre(MDOC_ARGS) |
|
static int |
static int |
mdoc_bx_pre(MDOC_ARGS) |
mdoc_bx_pre(MDOC_ARGS) |
{ |
{ |
const struct mdoc_node *nn; |
struct htmlpair tag; |
struct htmlpair tag; |
|
|
|
PAIR_CLASS_INIT(&tag, "unix"); |
PAIR_CLASS_INIT(&tag, "unix"); |
print_otag(h, TAG_SPAN, 1, &tag); |
print_otag(h, TAG_SPAN, 1, &tag); |
|
|
for (nn = n->child; nn; nn = nn->next) |
if (NULL != (n = n->child)) { |
print_mdoc_node(m, nn, h); |
print_text(h, n->string); |
|
h->flags |= HTML_NOSPACE; |
|
print_text(h, "BSD"); |
|
} else { |
|
print_text(h, "BSD"); |
|
return(0); |
|
} |
|
|
if (n->child) |
if (NULL != (n = n->next)) { |
h->flags |= HTML_NOSPACE; |
h->flags |= HTML_NOSPACE; |
|
print_text(h, "-"); |
|
h->flags |= HTML_NOSPACE; |
|
print_text(h, n->string); |
|
} |
|
|
print_text(h, "BSD"); |
|
return(0); |
return(0); |
} |
} |
|
|
|
|
mdoc_bd_pre(MDOC_ARGS) |
mdoc_bd_pre(MDOC_ARGS) |
{ |
{ |
struct htmlpair tag[2]; |
struct htmlpair tag[2]; |
int comp; |
int comp, sv; |
const struct mdoc_node *nn; |
const struct mdoc_node *nn; |
struct roffsu su; |
struct roffsu su; |
|
|
Line 1184 mdoc_bd_pre(MDOC_ARGS) |
|
Line 1223 mdoc_bd_pre(MDOC_ARGS) |
|
PAIR_CLASS_INIT(&tag[1], "lit display"); |
PAIR_CLASS_INIT(&tag[1], "lit display"); |
print_otag(h, TAG_PRE, 2, tag); |
print_otag(h, TAG_PRE, 2, tag); |
|
|
|
/* This can be recursive: save & set our literal state. */ |
|
|
|
sv = h->flags & HTML_LITERAL; |
|
h->flags |= HTML_LITERAL; |
|
|
for (nn = n->child; nn; nn = nn->next) { |
for (nn = n->child; nn; nn = nn->next) { |
print_mdoc_node(m, nn, h); |
print_mdoc_node(m, nn, h); |
/* |
/* |
Line 1219 mdoc_bd_pre(MDOC_ARGS) |
|
Line 1263 mdoc_bd_pre(MDOC_ARGS) |
|
|
|
h->flags |= HTML_NOSPACE; |
h->flags |= HTML_NOSPACE; |
} |
} |
|
|
|
if (0 == sv) |
|
h->flags &= ~HTML_LITERAL; |
|
|
return(0); |
return(0); |
} |
} |