diff options
-rw-r--r-- | man_html.c | 3 | ||||
-rw-r--r-- | man_term.c | 5 | ||||
-rw-r--r-- | mdoc_html.c | 6 | ||||
-rw-r--r-- | mdoc_term.c | 3 |
4 files changed, 10 insertions, 7 deletions
@@ -251,7 +251,8 @@ print_man_node(MAN_ARGS) case ROFFT_TEXT: if (fillmode(h, want_fillmode) == MAN_fi && want_fillmode == MAN_fi && - n->flags & NODE_LINE && *n->string == ' ') + n->flags & NODE_LINE && *n->string == ' ' && + (h->flags & HTML_NONEWLINE) == 0) print_otag(h, TAG_BR, ""); if (*n->string != '\0') break; @@ -873,10 +873,11 @@ print_man_node(DECL_ARGS) * If we have a space as the first character, break * before printing the line's data. */ - if ('\0' == *n->string) { + if (*n->string == '\0') { term_vspace(p); return; - } else if (' ' == *n->string && NODE_LINE & n->flags) + } else if (*n->string == ' ' && n->flags & NODE_LINE && + (p->flags & TERMP_NONEWLINE) == 0) term_newln(p); term_word(p, n->string); 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); diff --git a/mdoc_term.c b/mdoc_term.c index 0307cca6..245f58e5 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -342,7 +342,8 @@ print_mdoc_node(DECL_ARGS) switch (n->type) { case ROFFT_TEXT: - if (' ' == *n->string && NODE_LINE & n->flags) + if (*n->string == ' ' && n->flags & NODE_LINE && + (p->flags & TERMP_NONEWLINE) == 0) term_newln(p); if (NODE_DELIMC & n->flags) p->flags |= TERMP_NOSPACE; |