diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-03-30 23:34:32 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-03-30 23:34:32 +0000 |
commit | 31f620c338e4694ae72d96330057b88f2e65f394 (patch) | |
tree | a625a6cd2b569d3d2ef7d86bc76762960f1ac96c /mdoc_man.c | |
parent | 31a32116928bbca3f6efbb87356cad825ecc8210 (diff) | |
download | mandoc-31f620c338e4694ae72d96330057b88f2e65f394.tar.gz |
Improve formatting of broken blocks in -Tman,
somewhat similar to what mdoc_term.c already does for -Tascii.
OpenBSD rev. 1.58.
Diffstat (limited to 'mdoc_man.c')
-rw-r--r-- | mdoc_man.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -601,7 +601,7 @@ print_node(DECL_ARGS) */ act = manacts + n->tok; cond = NULL == act->cond || (*act->cond)(meta, n); - if (cond && act->pre) + if (cond && act->pre && ENDBODY_NOT == n->end) do_sub = (*act->pre)(meta, n); } @@ -617,8 +617,17 @@ print_node(DECL_ARGS) /* * Lastly, conditionally run the post-node handler. */ + if (MDOC_ENDED & n->flags) + return; + if (cond && act->post) (*act->post)(meta, n); + + if (ENDBODY_NOT != n->end) + n->pending->flags |= MDOC_ENDED; + + if (ENDBODY_NOSPACE == n->end) + outflags &= ~(MMAN_spc | MMAN_nl); } static int @@ -656,7 +665,7 @@ post_enc(DECL_ARGS) suffix = manacts[n->tok].suffix; if (NULL == suffix) return; - outflags &= ~MMAN_spc; + outflags &= ~(MMAN_spc | MMAN_nl); print_word(suffix); } |