diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2019-09-05 13:34:56 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2019-09-05 13:34:56 +0000 |
commit | 28a29bb407464222b109b8d9911cabecb54d887d (patch) | |
tree | ab52cba73766073a562ec197cf346f41f037d808 /usr.bin/mandoc/html.c | |
parent | 6ae6e21a6c12827b92152634affc0601f6178e5b (diff) |
Do not clear HTML_NOSPACE in print_indent().
I don't think there ever was a reason for doing so.
Besides, there is a discrepacy with respect to the point in the
document affected. That flag controls whitespace at the current
formatting point. But when HTML_BUFFER is in effect, the line break
and indentation is typically inserted one word further to the left.
Anything happening at that point to the left can't reasonably
influence spacing at the different point further to the right.
Among other effects, this change avoids some spurious line breaks
in HTML code at points where they weren't supposed to happen, line
breaks that in some cases caused undesirable, visible whitespace
when the resulting HTML was rendered.
Diffstat (limited to 'usr.bin/mandoc/html.c')
-rw-r--r-- | usr.bin/mandoc/html.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/usr.bin/mandoc/html.c b/usr.bin/mandoc/html.c index 2cc3e6e552d..fd0093eb578 100644 --- a/usr.bin/mandoc/html.c +++ b/usr.bin/mandoc/html.c @@ -1,4 +1,4 @@ -/* $OpenBSD: html.c,v 1.131 2019/09/03 18:07:57 schwarze Exp $ */ +/* $OpenBSD: html.c,v 1.132 2019/09/05 13:34:55 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011-2015, 2017-2019 Ingo Schwarze <schwarze@openbsd.org> @@ -966,15 +966,12 @@ print_indent(struct html *h) { size_t i; - if (h->col) + if (h->col || h->noindent) return; - if (h->noindent == 0) { - h->col = h->indent * 2; - for (i = 0; i < h->col; i++) - putchar(' '); - } - h->flags &= ~HTML_NOSPACE; + h->col = h->indent * 2; + for (i = 0; i < h->col; i++) + putchar(' '); } /* |