From f00c74d1aff97f47391d0a8652a8772045c5704c Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Thu, 5 Sep 2019 13:35:04 +0000 Subject: 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. --- html.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/html.c b/html.c index f5411bb3..f8ae7fb2 100644 --- a/html.c +++ b/html.c @@ -968,15 +968,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(' '); } /* -- cgit