version 1.252, 2013/12/24 19:11:46 |
version 1.253, 2013/12/24 20:45:27 |
Line 307 print_mdoc_node(DECL_ARGS) |
|
Line 307 print_mdoc_node(DECL_ARGS) |
|
/* |
/* |
* Keeps only work until the end of a line. If a keep was |
* Keeps only work until the end of a line. If a keep was |
* invoked in a prior line, revert it to PREKEEP. |
* invoked in a prior line, revert it to PREKEEP. |
* |
|
* Also let SYNPRETTY sections behave as if they were wrapped |
|
* in a `Bk' block. |
|
*/ |
*/ |
|
|
if (TERMP_KEEP & p->flags || MDOC_SYNPRETTY & n->flags) { |
if (TERMP_KEEP & p->flags) { |
if (n->prev ? (n->prev->lastline != n->line) : |
if (n->prev ? (n->prev->lastline != n->line) : |
(n->parent && n->parent->line != n->line)) { |
(n->parent && n->parent->line != n->line)) { |
p->flags &= ~TERMP_KEEP; |
p->flags &= ~TERMP_KEEP; |
Line 321 print_mdoc_node(DECL_ARGS) |
|
Line 318 print_mdoc_node(DECL_ARGS) |
|
} |
} |
|
|
/* |
/* |
* Since SYNPRETTY sections aren't "turned off" with `Ek', |
|
* we have to intuit whether we should disable formatting. |
|
*/ |
|
|
|
if ( ! (MDOC_SYNPRETTY & n->flags) && |
|
((n->prev && MDOC_SYNPRETTY & n->prev->flags) || |
|
(n->parent && MDOC_SYNPRETTY & n->parent->flags))) |
|
p->flags &= ~(TERMP_KEEP | TERMP_PREKEEP); |
|
|
|
/* |
|
* After the keep flags have been set up, we may now |
* After the keep flags have been set up, we may now |
* produce output. Note that some pre-handlers do so. |
* produce output. Note that some pre-handlers do so. |
*/ |
*/ |
|
|
termp_nm_pre(DECL_ARGS) |
termp_nm_pre(DECL_ARGS) |
{ |
{ |
|
|
if (MDOC_BLOCK == n->type) |
if (MDOC_BLOCK == n->type) { |
|
p->flags |= TERMP_PREKEEP; |
return(1); |
return(1); |
|
} |
|
|
if (MDOC_BODY == n->type) { |
if (MDOC_BODY == n->type) { |
if (NULL == n->child) |
if (NULL == n->child) |
|
|
termp_nm_post(DECL_ARGS) |
termp_nm_post(DECL_ARGS) |
{ |
{ |
|
|
if (MDOC_HEAD == n->type && n->next->child) { |
if (MDOC_BLOCK == n->type) { |
|
p->flags &= ~(TERMP_KEEP | TERMP_PREKEEP); |
|
} else if (MDOC_HEAD == n->type && n->next->child) { |
term_flushln(p); |
term_flushln(p); |
p->flags &= ~(TERMP_NOBREAK | TERMP_HANG); |
p->flags &= ~(TERMP_NOBREAK | TERMP_HANG); |
p->trailspace = 0; |
p->trailspace = 0; |
|
|
termp_bk_post(DECL_ARGS) |
termp_bk_post(DECL_ARGS) |
{ |
{ |
|
|
if (MDOC_BODY == n->type && ! (MDOC_SYNPRETTY & n->flags)) |
if (MDOC_BODY == n->type) |
p->flags &= ~(TERMP_KEEP | TERMP_PREKEEP); |
p->flags &= ~(TERMP_KEEP | TERMP_PREKEEP); |
} |
} |
|
|