diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2015-04-04 11:44:43 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2015-04-04 11:44:43 +0000 |
commit | a5c677ee3a4424a0bf941147a939dc444d3849cb (patch) | |
tree | a49c9899c4b443677786e269772f201e5333010f | |
parent | da181a763103d06750f7b921ac41c64de577f289 (diff) | |
download | mandoc-a5c677ee3a4424a0bf941147a939dc444d3849cb.tar.gz mandoc-a5c677ee3a4424a0bf941147a939dc444d3849cb.tar.zst mandoc-a5c677ee3a4424a0bf941147a939dc444d3849cb.zip |
Fix a quirk with respect to empty .HP.
Found while writing a regression test for man_macro.c rev. 1.66.
Incidentally, this brings rendering of XFreeEventData(3) closer to groff.
-rw-r--r-- | man_term.c | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -1,4 +1,4 @@ -/* $Id: man_term.c,v 1.173 2015/04/02 23:48:19 schwarze Exp $ */ +/* $Id: man_term.c,v 1.174 2015/04/04 11:44:43 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org> @@ -533,6 +533,17 @@ post_HP(DECL_ARGS) switch (n->type) { case ROFFT_BODY: term_newln(p); + + /* + * Compatibility with a groff bug. + * The .HP macro uses the undocumented .tag request + * which causes a line break and cancels no-space + * mode even if there isn't any output. + */ + + if (n->child == NULL) + term_vspace(p); + p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND); p->trailspace = 0; p->offset = mt->offset; |