source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mandoc: Do not clear HTML_NOSPACE in print_indent().
@ 2019-09-05 13:35 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2019-09-05 13:35 UTC (permalink / raw)
  To: source

Log Message:
-----------
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.

Modified Files:
--------------
    mandoc:
        html.c

Revision Data
-------------
Index: html.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/html.c,v
retrieving revision 1.260
retrieving revision 1.261
diff -Lhtml.c -Lhtml.c -u -p -r1.260 -r1.261
--- html.c
+++ 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(' ');
 }
 
 /*
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-09-05 13:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-05 13:35 mandoc: Do not clear HTML_NOSPACE in print_indent() schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).