From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id d6fe7d22 for ; Tue, 9 May 2017 09:10:31 -0500 (EST) Date: Tue, 9 May 2017 09:10:31 -0500 (EST) Message-Id: <11188641381995293716.enqueue@fantadrom.bsd.lv> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: Trailing \c suppresses the output line break even if the next X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- Trailing \c suppresses the output line break even if the next line is a text line starting with whitespace. Quirk found in the sysutils/rancid port. Modified Files: -------------- mdocml: man_html.c man_term.c mdoc_html.c mdoc_term.c Revision Data ------------- Index: man_term.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/man_term.c,v retrieving revision 1.199 retrieving revision 1.200 diff -Lman_term.c -Lman_term.c -u -p -r1.199 -r1.200 --- man_term.c +++ man_term.c @@ -873,10 +873,11 @@ print_man_node(DECL_ARGS) * If we have a space as the first character, break * before printing the line's data. */ - if ('\0' == *n->string) { + if (*n->string == '\0') { term_vspace(p); return; - } else if (' ' == *n->string && NODE_LINE & n->flags) + } else if (*n->string == ' ' && n->flags & NODE_LINE && + (p->flags & TERMP_NONEWLINE) == 0) term_newln(p); term_word(p, n->string); Index: man_html.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/man_html.c,v retrieving revision 1.141 retrieving revision 1.142 diff -Lman_html.c -Lman_html.c -u -p -r1.141 -r1.142 --- man_html.c +++ man_html.c @@ -251,7 +251,8 @@ print_man_node(MAN_ARGS) case ROFFT_TEXT: if (fillmode(h, want_fillmode) == MAN_fi && want_fillmode == MAN_fi && - n->flags & NODE_LINE && *n->string == ' ') + n->flags & NODE_LINE && *n->string == ' ' && + (h->flags & HTML_NONEWLINE) == 0) print_otag(h, TAG_BR, ""); if (*n->string != '\0') break; Index: mdoc_term.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/mdoc_term.c,v retrieving revision 1.356 retrieving revision 1.357 diff -Lmdoc_term.c -Lmdoc_term.c -u -p -r1.356 -r1.357 --- mdoc_term.c +++ mdoc_term.c @@ -342,7 +342,8 @@ print_mdoc_node(DECL_ARGS) switch (n->type) { case ROFFT_TEXT: - if (' ' == *n->string && NODE_LINE & n->flags) + if (*n->string == ' ' && n->flags & NODE_LINE && + (p->flags & TERMP_NONEWLINE) == 0) term_newln(p); if (NODE_DELIMC & n->flags) p->flags |= TERMP_NOSPACE; Index: mdoc_html.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/mdoc_html.c,v retrieving revision 1.285 retrieving revision 1.286 diff -Lmdoc_html.c -Lmdoc_html.c -u -p -r1.285 -r1.286 --- mdoc_html.c +++ mdoc_html.c @@ -359,9 +359,9 @@ print_mdoc_node(MDOC_ARGS) * Make sure that if we're in a literal mode already * (i.e., within a
) don't print the newline.
 		 */
-		if (' ' == *n->string && NODE_LINE & n->flags)
-			if ( ! (HTML_LITERAL & h->flags))
-				print_otag(h, TAG_BR, "");
+		if (*n->string == ' ' && n->flags & NODE_LINE &&
+		    (h->flags & (HTML_LITERAL | HTML_NONEWLINE)) == 0)
+			print_otag(h, TAG_BR, "");
 		if (NODE_DELIMC & n->flags)
 			h->flags |= HTML_NOSPACE;
 		print_text(h, n->string);
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv