summaryrefslogtreecommitdiffstats
path: root/mdoc_html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-05-09 14:10:01 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-05-09 14:10:01 +0000
commit05c1408b281441f3ec02a7ae478be405fab9635a (patch)
treee9b1ab78d59841bec667b6bd5b0d4c78c50187c6 /mdoc_html.c
parent73dc5e8b721bdd4c7e867dc7dd39d4f8dec3e3a9 (diff)
downloadmandoc-05c1408b281441f3ec02a7ae478be405fab9635a.tar.gz
Trailing \c suppresses the output line break even if
the next line is a text line starting with whitespace. Quirk found in the sysutils/rancid port.
Diffstat (limited to 'mdoc_html.c')
-rw-r--r--mdoc_html.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mdoc_html.c b/mdoc_html.c
index 85dfa5a5..db85b3a7 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -359,9 +359,9 @@ print_mdoc_node(MDOC_ARGS)
* Make sure that if we're in a literal mode already
* (i.e., within a <PRE>) don't print the newline.
*/
- if (' ' == *n->string && NODE_LINE & n->flags)
- if ( ! (HTML_LITERAL & h->flags))
- print_otag(h, TAG_BR, "");
+ if (*n->string == ' ' && n->flags & NODE_LINE &&
+ (h->flags & (HTML_LITERAL | HTML_NONEWLINE)) == 0)
+ print_otag(h, TAG_BR, "");
if (NODE_DELIMC & n->flags)
h->flags |= HTML_NOSPACE;
print_text(h, n->string);