diff options
author | 2017-05-09 14:09:37 +0000 | |
---|---|---|
committer | 2017-05-09 14:09:37 +0000 | |
commit | 74591f1e552ab9149968418ffe096c81a891092b (patch) | |
tree | 488dcfd716c794dedbfd42480b10db843417b453 /usr.bin/mandoc/mdoc_html.c | |
parent | Prevent memory leak on sbuf by freeing it unconditionally and ensure (diff) | |
download | wireguard-openbsd-74591f1e552ab9149968418ffe096c81a891092b.tar.xz wireguard-openbsd-74591f1e552ab9149968418ffe096c81a891092b.zip |
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 'usr.bin/mandoc/mdoc_html.c')
-rw-r--r-- | usr.bin/mandoc/mdoc_html.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/mandoc/mdoc_html.c b/usr.bin/mandoc/mdoc_html.c index 77a30751688..5efe1666c1c 100644 --- a/usr.bin/mandoc/mdoc_html.c +++ b/usr.bin/mandoc/mdoc_html.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mdoc_html.c,v 1.160 2017/05/05 15:16:25 schwarze Exp $ */ +/* $OpenBSD: mdoc_html.c,v 1.161 2017/05/09 14:09:37 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze <schwarze@openbsd.org> @@ -357,9 +357,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); |