summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/mdoc_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2014-08-21 12:56:25 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2014-08-21 12:56:25 +0000
commitcdd69415955f3b490794c5de779d1fa8f8003095 (patch)
tree6dbe0e34d19ba881324e361478637925374e1c9b /usr.bin/mandoc/mdoc_term.c
parentca085c6139a644968809f97505ada5bc375ff2c9 (diff)
Right after .Fl, a middle delimiter triggers an empty scope,
just like a closing delimiter. This didn't work in groff-1.15, but it now works in groff-1.22. After being closed by delimiters, .Nm scopes do not reopen. Do not suppress white space after .Fl if the next node is a text node on the same input line; that can happen for middle delimiters. Fixing an issue reported by jmc@.
Diffstat (limited to 'usr.bin/mandoc/mdoc_term.c')
-rw-r--r--usr.bin/mandoc/mdoc_term.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/mandoc/mdoc_term.c b/usr.bin/mandoc/mdoc_term.c
index b37173034d9..962a638f2f8 100644
--- a/usr.bin/mandoc/mdoc_term.c
+++ b/usr.bin/mandoc/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_term.c,v 1.178 2014/08/17 18:42:07 schwarze Exp $ */
+/* $Id: mdoc_term.c,v 1.179 2014/08/21 12:56:24 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -1073,9 +1073,10 @@ termp_fl_pre(DECL_ARGS)
term_fontpush(p, TERMFONT_BOLD);
term_word(p, "\\-");
- if (n->child)
- p->flags |= TERMP_NOSPACE;
- else if (n->next && n->next->line == n->line)
+ if ( ! (n->nchild == 0 &&
+ (n->next == NULL ||
+ n->next->type == MDOC_TEXT ||
+ n->next->flags & MDOC_LINE)))
p->flags |= TERMP_NOSPACE;
return(1);