aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2013-12-24 19:11:45 +0000
committerIngo Schwarze <schwarze@openbsd.org>2013-12-24 19:11:45 +0000
commitb303922601f56d18c6f93423c4ff3d27382f885e (patch)
treeffc9e8ded8098926789638d9ae1ecb3aec856e4e /mdoc_html.c
parent34224dec94613f2de8682103514f13b796cbb181 (diff)
downloadmandoc-b303922601f56d18c6f93423c4ff3d27382f885e.tar.gz
mandoc-b303922601f56d18c6f93423c4ff3d27382f885e.tar.zst
mandoc-b303922601f56d18c6f93423c4ff3d27382f885e.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 'mdoc_html.c')
-rw-r--r--mdoc_html.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/mdoc_html.c b/mdoc_html.c
index ba93749b..151657fb 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_html.c,v 1.184 2012/11/17 00:26:33 schwarze Exp $ */
+/* $Id: mdoc_html.c,v 1.185 2013/12/24 19:11:46 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -459,15 +459,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;
- }
}
}