summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-04-04 11:44:43 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-04-04 11:44:43 +0000
commitd4849c125a2536970d94e48746b9c97cddeee0c1 (patch)
tree2d9dab87624469ef0c868198dcfbc19c97ac3c66
parentfeb386c64b508cc5bd8206298625ac7d79cbf93b (diff)
downloadmandoc-d4849c125a2536970d94e48746b9c97cddeee0c1.tar.gz
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.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/man_term.c b/man_term.c
index 473b25e4..d0dd4263 100644
--- a/man_term.c
+++ b/man_term.c
@@ -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;