diff options
author | 2014-01-24 11:56:34 +0000 | |
---|---|---|
committer | 2014-01-24 11:56:34 +0000 | |
commit | e63c26677105c65e88f6d44c95985742e1cecbca (patch) | |
tree | 0ae18a7a6598f0bc989f0c7312db01f9cedb850b /usr.bin/mandoc/mdoc_man.c | |
parent | subject -z hints (fuzzy update) to quirks' tweak_search. (diff) | |
download | wireguard-openbsd-e63c26677105c65e88f6d44c95985742e1cecbca.tar.xz wireguard-openbsd-e63c26677105c65e88f6d44c95985742e1cecbca.zip |
Improve formatting of broken blocks in -Tman,
somewhat similar to what mdoc_term.c already does for -Tascii.
Diffstat (limited to 'usr.bin/mandoc/mdoc_man.c')
-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); } |