aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2019-09-05 13:35:04 +0000
committerIngo Schwarze <schwarze@openbsd.org>2019-09-05 13:35:04 +0000
commitda2ed79766edb8b2d1dd36183704b9ec06b315d2 (patch)
tree8dbf38967c158de5390bfbebb2bac1e917bf0837 /html.c
parentb1ad91c5a16d5524b4b2b04aa37194c728a02d6e (diff)
downloadmandoc-da2ed79766edb8b2d1dd36183704b9ec06b315d2.tar.gz
mandoc-da2ed79766edb8b2d1dd36183704b9ec06b315d2.tar.zst
mandoc-da2ed79766edb8b2d1dd36183704b9ec06b315d2.zip
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 'html.c')
-rw-r--r--html.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/html.c b/html.c
index c9e5c2b4..50fa78ce 100644
--- a/html.c
+++ b/html.c
@@ -1,4 +1,4 @@
-/* $Id: html.c,v 1.260 2019/09/03 18:08:02 schwarze Exp $ */
+/* $Id: html.c,v 1.261 2019/09/05 13:35:04 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2015, 2017-2019 Ingo Schwarze <schwarze@openbsd.org>
@@ -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(' ');
}
/*