version 1.136, 2010/12/23 00:45:03 |
version 1.137, 2010/12/24 14:00:40 |
Line 839 mdoc_it_pre(MDOC_ARGS) |
|
Line 839 mdoc_it_pre(MDOC_ARGS) |
|
|
|
assert(bl); |
assert(bl); |
|
|
type = bl->norm->d.Bl.type; |
type = bl->norm->Bl.type; |
|
|
assert(lists[type]); |
assert(lists[type]); |
PAIR_CLASS_INIT(&tag[0], lists[type]); |
PAIR_CLASS_INIT(&tag[0], lists[type]); |
Line 865 mdoc_it_pre(MDOC_ARGS) |
|
Line 865 mdoc_it_pre(MDOC_ARGS) |
|
case(LIST_ohang): |
case(LIST_ohang): |
/* FALLTHROUGH */ |
/* FALLTHROUGH */ |
case(LIST_tag): |
case(LIST_tag): |
SCALE_VS_INIT(&su, ! bl->norm->d.Bl.comp); |
SCALE_VS_INIT(&su, ! bl->norm->Bl.comp); |
bufcat_su(h, "margin-top", &su); |
bufcat_su(h, "margin-top", &su); |
PAIR_STYLE_INIT(&tag[1], h); |
PAIR_STYLE_INIT(&tag[1], h); |
print_otag(h, TAG_DT, 2, tag); |
print_otag(h, TAG_DT, 2, tag); |
Line 890 mdoc_it_pre(MDOC_ARGS) |
|
Line 890 mdoc_it_pre(MDOC_ARGS) |
|
case(LIST_enum): |
case(LIST_enum): |
/* FALLTHROUGH */ |
/* FALLTHROUGH */ |
case(LIST_item): |
case(LIST_item): |
SCALE_VS_INIT(&su, ! bl->norm->d.Bl.comp); |
SCALE_VS_INIT(&su, ! bl->norm->Bl.comp); |
bufcat_su(h, "margin-top", &su); |
bufcat_su(h, "margin-top", &su); |
PAIR_STYLE_INIT(&tag[1], h); |
PAIR_STYLE_INIT(&tag[1], h); |
print_otag(h, TAG_LI, 2, tag); |
print_otag(h, TAG_LI, 2, tag); |
Line 904 mdoc_it_pre(MDOC_ARGS) |
|
Line 904 mdoc_it_pre(MDOC_ARGS) |
|
case(LIST_ohang): |
case(LIST_ohang): |
/* FALLTHROUGH */ |
/* FALLTHROUGH */ |
case(LIST_tag): |
case(LIST_tag): |
if (NULL == bl->norm->d.Bl.width) { |
if (NULL == bl->norm->Bl.width) { |
print_otag(h, TAG_DD, 1, tag); |
print_otag(h, TAG_DD, 1, tag); |
break; |
break; |
} |
} |
a2width(bl->norm->d.Bl.width, &su); |
a2width(bl->norm->Bl.width, &su); |
bufcat_su(h, "margin-left", &su); |
bufcat_su(h, "margin-left", &su); |
PAIR_STYLE_INIT(&tag[1], h); |
PAIR_STYLE_INIT(&tag[1], h); |
print_otag(h, TAG_DD, 2, tag); |
print_otag(h, TAG_DD, 2, tag); |
break; |
break; |
case(LIST_column): |
case(LIST_column): |
SCALE_VS_INIT(&su, ! bl->norm->d.Bl.comp); |
SCALE_VS_INIT(&su, ! bl->norm->Bl.comp); |
bufcat_su(h, "margin-top", &su); |
bufcat_su(h, "margin-top", &su); |
PAIR_STYLE_INIT(&tag[1], h); |
PAIR_STYLE_INIT(&tag[1], h); |
print_otag(h, TAG_TD, 2, tag); |
print_otag(h, TAG_TD, 2, tag); |
Line 945 mdoc_bl_pre(MDOC_ARGS) |
|
Line 945 mdoc_bl_pre(MDOC_ARGS) |
|
char buf[BUFSIZ]; |
char buf[BUFSIZ]; |
|
|
if (MDOC_BODY == n->type) { |
if (MDOC_BODY == n->type) { |
if (LIST_column == n->norm->d.Bl.type) |
if (LIST_column == n->norm->Bl.type) |
print_otag(h, TAG_TBODY, 0, NULL); |
print_otag(h, TAG_TBODY, 0, NULL); |
return(1); |
return(1); |
} |
} |
|
|
if (MDOC_HEAD == n->type) { |
if (MDOC_HEAD == n->type) { |
if (LIST_column != n->norm->d.Bl.type) |
if (LIST_column != n->norm->Bl.type) |
return(0); |
return(0); |
|
|
/* |
/* |
Line 961 mdoc_bl_pre(MDOC_ARGS) |
|
Line 961 mdoc_bl_pre(MDOC_ARGS) |
|
* screen and we want to preserve that behaviour. |
* screen and we want to preserve that behaviour. |
*/ |
*/ |
|
|
for (i = 0; i < n->norm->d.Bl.ncols; i++) { |
for (i = 0; i < n->norm->Bl.ncols; i++) { |
a2width(n->norm->d.Bl.cols[i], &su); |
a2width(n->norm->Bl.cols[i], &su); |
bufinit(h); |
bufinit(h); |
if (i < n->norm->d.Bl.ncols - 1) |
if (i < n->norm->Bl.ncols - 1) |
bufcat_su(h, "width", &su); |
bufcat_su(h, "width", &su); |
else |
else |
bufcat_su(h, "min-width", &su); |
bufcat_su(h, "min-width", &su); |
Line 980 mdoc_bl_pre(MDOC_ARGS) |
|
Line 980 mdoc_bl_pre(MDOC_ARGS) |
|
bufcat_su(h, "margin-bottom", &su); |
bufcat_su(h, "margin-bottom", &su); |
PAIR_STYLE_INIT(&tag[0], h); |
PAIR_STYLE_INIT(&tag[0], h); |
|
|
assert(lists[n->norm->d.Bl.type]); |
assert(lists[n->norm->Bl.type]); |
strlcpy(buf, "list ", BUFSIZ); |
strlcpy(buf, "list ", BUFSIZ); |
strlcat(buf, lists[n->norm->d.Bl.type], BUFSIZ); |
strlcat(buf, lists[n->norm->Bl.type], BUFSIZ); |
PAIR_INIT(&tag[1], ATTR_CLASS, buf); |
PAIR_INIT(&tag[1], ATTR_CLASS, buf); |
|
|
/* Set the block's left-hand margin. */ |
/* Set the block's left-hand margin. */ |
|
|
if (n->norm->d.Bl.offs) { |
if (n->norm->Bl.offs) { |
a2offs(n->norm->d.Bl.offs, &su); |
a2offs(n->norm->Bl.offs, &su); |
bufcat_su(h, "margin-left", &su); |
bufcat_su(h, "margin-left", &su); |
} |
} |
|
|
switch (n->norm->d.Bl.type) { |
switch (n->norm->Bl.type) { |
case(LIST_bullet): |
case(LIST_bullet): |
/* FALLTHROUGH */ |
/* FALLTHROUGH */ |
case(LIST_dash): |
case(LIST_dash): |
Line 1145 mdoc_bd_pre(MDOC_ARGS) |
|
Line 1145 mdoc_bd_pre(MDOC_ARGS) |
|
return(0); |
return(0); |
|
|
if (MDOC_BLOCK == n->type) { |
if (MDOC_BLOCK == n->type) { |
comp = n->norm->d.Bd.comp; |
comp = n->norm->Bd.comp; |
for (nn = n; nn && ! comp; nn = nn->parent) { |
for (nn = n; nn && ! comp; nn = nn->parent) { |
if (MDOC_BLOCK != nn->type) |
if (MDOC_BLOCK != nn->type) |
continue; |
continue; |
Line 1160 mdoc_bd_pre(MDOC_ARGS) |
|
Line 1160 mdoc_bd_pre(MDOC_ARGS) |
|
} |
} |
|
|
SCALE_HS_INIT(&su, 0); |
SCALE_HS_INIT(&su, 0); |
if (n->norm->d.Bd.offs) |
if (n->norm->Bd.offs) |
a2offs(n->norm->d.Bd.offs, &su); |
a2offs(n->norm->Bd.offs, &su); |
|
|
bufcat_su(h, "margin-left", &su); |
bufcat_su(h, "margin-left", &su); |
PAIR_STYLE_INIT(&tag[0], h); |
PAIR_STYLE_INIT(&tag[0], h); |
|
|
if (DISP_unfilled != n->norm->d.Bd.type && |
if (DISP_unfilled != n->norm->Bd.type && |
DISP_literal != n->norm->d.Bd.type) { |
DISP_literal != n->norm->Bd.type) { |
PAIR_CLASS_INIT(&tag[1], "display"); |
PAIR_CLASS_INIT(&tag[1], "display"); |
print_otag(h, TAG_DIV, 2, tag); |
print_otag(h, TAG_DIV, 2, tag); |
return(1); |
return(1); |
Line 1750 mdoc_bf_pre(MDOC_ARGS) |
|
Line 1750 mdoc_bf_pre(MDOC_ARGS) |
|
else if (MDOC_BODY != n->type) |
else if (MDOC_BODY != n->type) |
return(1); |
return(1); |
|
|
if (FONT_Em == n->norm->d.Bf.font) |
if (FONT_Em == n->norm->Bf.font) |
PAIR_CLASS_INIT(&tag[0], "emph"); |
PAIR_CLASS_INIT(&tag[0], "emph"); |
else if (FONT_Sy == n->norm->d.Bf.font) |
else if (FONT_Sy == n->norm->Bf.font) |
PAIR_CLASS_INIT(&tag[0], "symb"); |
PAIR_CLASS_INIT(&tag[0], "symb"); |
else if (FONT_Li == n->norm->d.Bf.font) |
else if (FONT_Li == n->norm->Bf.font) |
PAIR_CLASS_INIT(&tag[0], "lit"); |
PAIR_CLASS_INIT(&tag[0], "lit"); |
else |
else |
PAIR_CLASS_INIT(&tag[0], "none"); |
PAIR_CLASS_INIT(&tag[0], "none"); |