version 1.15, 2009/06/17 18:42:42 |
version 1.19, 2009/07/04 11:04:46 |
Line 533 arg_width(const struct mdoc_argv *arg, int pos) |
|
Line 533 arg_width(const struct mdoc_argv *arg, int pos) |
|
assert(pos < (int)arg->sz && pos >= 0); |
assert(pos < (int)arg->sz && pos >= 0); |
assert(arg->value[pos]); |
assert(arg->value[pos]); |
if (0 == strcmp(arg->value[pos], "indent")) |
if (0 == strcmp(arg->value[pos], "indent")) |
return(INDENT); |
return(INDENT + 3); |
if (0 == strcmp(arg->value[pos], "indent-two")) |
if (0 == strcmp(arg->value[pos], "indent-two")) |
return(INDENT * 2); |
return(INDENT * 2 + 2); |
|
|
if (0 == (len = (int)strlen(arg->value[pos]))) |
if (0 == (len = (int)strlen(arg->value[pos]))) |
return(0); |
return(0); |
Line 545 arg_width(const struct mdoc_argv *arg, int pos) |
|
Line 545 arg_width(const struct mdoc_argv *arg, int pos) |
|
break; |
break; |
|
|
if (i == len - 1) { |
if (i == len - 1) { |
if ('n' == arg->value[pos][len - 1]) { |
if ('n' == arg->value[pos][len - 1] || |
|
'm' == arg->value[pos][len - 1]) { |
v = (size_t)atoi(arg->value[pos]); |
v = (size_t)atoi(arg->value[pos]); |
return(v); |
return(v + 2); |
} |
} |
|
|
} |
} |
return(strlen(arg->value[pos]) + 1); |
return(strlen(arg->value[pos]) + 2); |
} |
} |
|
|
|
|
Line 605 arg_offset(const struct mdoc_argv *arg) |
|
Line 606 arg_offset(const struct mdoc_argv *arg) |
|
if (0 == strcmp(*arg->value, "left")) |
if (0 == strcmp(*arg->value, "left")) |
return(0); |
return(0); |
if (0 == strcmp(*arg->value, "indent")) |
if (0 == strcmp(*arg->value, "indent")) |
return(INDENT); |
return(INDENT + 1); |
if (0 == strcmp(*arg->value, "indent-two")) |
if (0 == strcmp(*arg->value, "indent-two")) |
return(INDENT * 2); |
return(INDENT * 2); |
|
|
Line 760 termp_it_pre(DECL_ARGS) |
|
Line 761 termp_it_pre(DECL_ARGS) |
|
if (vals[0] >= 0) |
if (vals[0] >= 0) |
width = arg_width(&bl->args->argv[vals[0]], 0); |
width = arg_width(&bl->args->argv[vals[0]], 0); |
if (vals[1] >= 0) |
if (vals[1] >= 0) |
offset = arg_offset(&bl->args->argv[vals[1]]); |
offset += arg_offset(&bl->args->argv[vals[1]]); |
break; |
break; |
} |
} |
|
|
Line 775 termp_it_pre(DECL_ARGS) |
|
Line 776 termp_it_pre(DECL_ARGS) |
|
/* FALLTHROUGH */ |
/* FALLTHROUGH */ |
case (MDOC_Dash): |
case (MDOC_Dash): |
/* FALLTHROUGH */ |
/* FALLTHROUGH */ |
case (MDOC_Enum): |
|
/* FALLTHROUGH */ |
|
case (MDOC_Hyphen): |
case (MDOC_Hyphen): |
if (width < 4) |
if (width < 4) |
width = 4; |
width = 4; |
break; |
break; |
|
case (MDOC_Enum): |
|
if (width < 5) |
|
width = 5; |
|
break; |
case (MDOC_Tag): |
case (MDOC_Tag): |
if (0 == width) |
if (0 == width) |
width = 10; |
width = 10; |
Line 790 termp_it_pre(DECL_ARGS) |
|
Line 793 termp_it_pre(DECL_ARGS) |
|
} |
} |
|
|
/* |
/* |
* Whitespace control. Inset bodies need an initial space. |
* Whitespace control. Inset bodies need an initial space, |
|
* while diagonal bodies need two. |
*/ |
*/ |
|
|
switch (type) { |
switch (type) { |
case (MDOC_Diag): |
case (MDOC_Diag): |
|
term_word(p, "\\ "); |
/* FALLTHROUGH */ |
/* FALLTHROUGH */ |
case (MDOC_Inset): |
case (MDOC_Inset): |
if (MDOC_BODY == node->type) |
if (MDOC_BODY == node->type) |
Line 1304 termp_lb_pre(DECL_ARGS) |
|
Line 1309 termp_lb_pre(DECL_ARGS) |
|
const char *lb; |
const char *lb; |
|
|
assert(node->child && MDOC_TEXT == node->child->type); |
assert(node->child && MDOC_TEXT == node->child->type); |
if ((lb = mdoc_a2lib(node->child->string))) { |
lb = mdoc_a2lib(node->child->string); |
|
if (lb) { |
term_word(p, lb); |
term_word(p, lb); |
return(0); |
return(0); |
} |
} |
Line 1340 termp_d1_pre(DECL_ARGS) |
|
Line 1346 termp_d1_pre(DECL_ARGS) |
|
if (MDOC_BLOCK != node->type) |
if (MDOC_BLOCK != node->type) |
return(1); |
return(1); |
term_newln(p); |
term_newln(p); |
p->offset += (pair->offset = INDENT); |
pair->offset = INDENT + 1; |
|
p->offset += pair->offset; |
return(1); |
return(1); |
} |
} |
|
|