diff options
-rw-r--r-- | man_html.c | 5 | ||||
-rw-r--r-- | man_term.c | 7 | ||||
-rw-r--r-- | mdoc_html.c | 8 | ||||
-rw-r--r-- | mdoc_term.c | 5 |
4 files changed, 14 insertions, 11 deletions
@@ -1,4 +1,4 @@ -/* $Id: man_html.c,v 1.141 2017/05/05 15:17:32 schwarze Exp $ */ +/* $Id: man_html.c,v 1.142 2017/05/09 14:10:01 schwarze Exp $ */ /* * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2013, 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org> @@ -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; @@ -1,4 +1,4 @@ -/* $Id: man_term.c,v 1.199 2017/05/07 21:44:49 schwarze Exp $ */ +/* $Id: man_term.c,v 1.200 2017/05/09 14:10:01 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2015, 2017 Ingo Schwarze <schwarze@openbsd.org> @@ -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 9819c2ff..2ad35035 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.285 2017/05/05 15:17:32 schwarze Exp $ */ +/* $Id: mdoc_html.c,v 1.286 2017/05/09 14:10:01 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze <schwarze@openbsd.org> @@ -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 08620365..e4c0b92c 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.356 2017/05/07 17:31:45 schwarze Exp $ */ +/* $Id: mdoc_term.c,v 1.357 2017/05/09 14:10:01 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010, 2012-2017 Ingo Schwarze <schwarze@openbsd.org> @@ -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; |