diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2014-01-24 11:56:35 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2014-01-24 11:56:35 +0000 |
commit | 2280bcec86252e6c17969e61e8c530213b977ed8 (patch) | |
tree | 49662f715317f45b643fac43664651abafa5d2ab /usr.bin | |
parent | 78c72f07f66899c67ada30fab21ffffa02adb6e1 (diff) |
Improve formatting of broken blocks in -Tman,
somewhat similar to what mdoc_term.c already does for -Tascii.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/mandoc/mdoc_man.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/usr.bin/mandoc/mdoc_man.c b/usr.bin/mandoc/mdoc_man.c index 031f6b15398..f4647974021 100644 --- a/usr.bin/mandoc/mdoc_man.c +++ b/usr.bin/mandoc/mdoc_man.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_man.c,v 1.57 2014/01/22 20:58:35 schwarze Exp $ */ +/* $Id: mdoc_man.c,v 1.58 2014/01/24 11:56:34 schwarze Exp $ */ /* * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org> * @@ -594,7 +594,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); } @@ -610,8 +610,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 @@ -649,7 +658,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); } |