diff options
author | 2013-12-24 19:10:34 +0000 | |
---|---|---|
committer | 2013-12-24 19:10:34 +0000 | |
commit | f7bdb1a2ed64b531d6a5bd917c4e67a96a4a362b (patch) | |
tree | 884a872fbfe02211be50d6591ea97992dd61fe95 /usr.bin/mandoc/mdoc_html.c | |
parent | More .Bk tests to lessen the risk of upcoming work. (diff) | |
download | wireguard-openbsd-f7bdb1a2ed64b531d6a5bd917c4e67a96a4a362b.tar.xz wireguard-openbsd-f7bdb1a2ed64b531d6a5bd917c4e67a96a4a362b.zip |
When deciding whether two consecutive macros are on the same input line,
we have to compare the line where the first one *ends* (not where it begins)
to the line where the second one starts.
This fixes the bug that .Bk allowed output line breaks right after block
macros spanning more than one input line, even when the next macro follows
on the same line.
Diffstat (limited to 'usr.bin/mandoc/mdoc_html.c')
-rw-r--r-- | usr.bin/mandoc/mdoc_html.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/usr.bin/mandoc/mdoc_html.c b/usr.bin/mandoc/mdoc_html.c index d1c544e177a..ec49796ead2 100644 --- a/usr.bin/mandoc/mdoc_html.c +++ b/usr.bin/mandoc/mdoc_html.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.67 2012/11/17 00:25:20 schwarze Exp $ */ +/* $Id: mdoc_html.c,v 1.68 2013/12/24 19:10:34 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -455,15 +455,11 @@ print_mdoc_node(MDOC_ARGS) break; } - if (HTML_KEEP & h->flags) { - if (n->prev && n->prev->line != n->line) { + if (HTML_KEEP & h->flags || MDOC_SYNPRETTY & n->flags) { + if (n->prev ? (n->prev->lastline != n->line) : + (n->parent && n->parent->line != n->line)) { h->flags &= ~HTML_KEEP; h->flags |= HTML_PREKEEP; - } else if (NULL == n->prev) { - if (n->parent && n->parent->line != n->line) { - h->flags &= ~HTML_KEEP; - h->flags |= HTML_PREKEEP; - } } } |