source@mandoc.bsd.lv
 help / color / 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, back to index

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

source@mandoc.bsd.lv

Archives are clonable: git clone --mirror http://inbox.vuxu.org/mandoc-source

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.mandoc.source


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git