=================================================================== RCS file: /cvs/mandoc/mdoc_html.c,v retrieving revision 1.284 retrieving revision 1.288 diff -u -p -r1.284 -r1.288 --- mandoc/mdoc_html.c 2017/05/05 13:17:55 1.284 +++ mandoc/mdoc_html.c 2017/05/17 17:54:45 1.288 @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.284 2017/05/05 13:17:55 schwarze Exp $ */ +/* $Id: mdoc_html.c,v 1.288 2017/05/17 17:54:45 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze @@ -108,7 +108,6 @@ static int mdoc_rs_pre(MDOC_ARGS); static int mdoc_sh_pre(MDOC_ARGS); static int mdoc_skip_pre(MDOC_ARGS); static int mdoc_sm_pre(MDOC_ARGS); -static int mdoc_sp_pre(MDOC_ARGS); static int mdoc_ss_pre(MDOC_ARGS); static int mdoc_st_pre(MDOC_ARGS); static int mdoc_sx_pre(MDOC_ARGS); @@ -237,7 +236,6 @@ static const struct htmlmdoc __mdocs[MDOC_MAX - MDOC_D {mdoc_quote_pre, mdoc_quote_post}, /* En */ {mdoc_xx_pre, NULL}, /* Dx */ {mdoc__x_pre, mdoc__x_post}, /* %Q */ - {mdoc_sp_pre, NULL}, /* sp */ {mdoc__x_pre, mdoc__x_post}, /* %U */ {NULL, NULL}, /* Ta */ }; @@ -361,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);
@@ -587,9 +585,6 @@ mdoc_nd_pre(MDOC_ARGS)
 static int
 mdoc_nm_pre(MDOC_ARGS)
 {
-	struct tag	*t;
-	int		 len;
-
 	switch (n->type) {
 	case ROFFT_HEAD:
 		print_otag(h, TAG_TD, "");
@@ -603,22 +598,8 @@ mdoc_nm_pre(MDOC_ARGS)
 	default:
 		break;
 	}
-
 	synopsis_pre(h, n);
 	print_otag(h, TAG_TABLE, "c", "Nm");
-
-	for (len = 0, n = n->head->child; n; n = n->next)
-		if (n->type == ROFFT_TEXT)
-			len += html_strlen(n->string);
-
-	if (len == 0 && meta->name != NULL)
-		len = html_strlen(meta->name);
-
-	t = print_otag(h, TAG_COLGROUP, "");
-	/* Increase width to make even bold text fit. */
-	print_otag(h, TAG_COL, "shw", len + 2);
-	print_otag(h, TAG_COL, "");
-	print_tagq(h, t);
 	print_otag(h, TAG_TR, "");
 	return 1;
 }
@@ -770,7 +751,7 @@ mdoc_it_pre(MDOC_ARGS)
 			    (n->parent->prev == NULL ||
 			     n->parent->prev->body == NULL ||
 			     n->parent->prev->body->child != NULL)) {
-				t = print_otag(h, TAG_DT, "csWl",
+				t = print_otag(h, TAG_DT, "csw+-l",
 				    cattr, bl->norm->Bl.width);
 				print_text(h, "\\ ");
 				print_tagq(h, t);
@@ -778,7 +759,7 @@ mdoc_it_pre(MDOC_ARGS)
 				print_text(h, "\\ ");
 				print_tagq(h, t);
 			}
-			print_otag(h, TAG_DT, "csWl", cattr,
+			print_otag(h, TAG_DT, "csw+-l", cattr,
 			    bl->norm->Bl.width);
 			break;
 		case ROFFT_BODY:
@@ -841,7 +822,7 @@ mdoc_bl_pre(MDOC_ARGS)
 
 		t = print_otag(h, TAG_COLGROUP, "");
 		for (i = 0; i < bl->ncols - 1; i++)
-			print_otag(h, TAG_COL, "sww", bl->cols[i]);
+			print_otag(h, TAG_COL, "sw+w", bl->cols[i]);
 		print_otag(h, TAG_COL, "swW", bl->cols[i]);
 		print_tagq(h, t);
 		return 0;
@@ -888,7 +869,7 @@ mdoc_bl_pre(MDOC_ARGS)
 		cattr = "Bl-tag";
 		if (bl->offs)
 			print_otag(h, TAG_DIV, "cswl", cattr, bl->offs);
-		print_otag(h, TAG_DL, "cswl", cattr, bl->width);
+		print_otag(h, TAG_DL, "csw+l", cattr, bl->width);
 		return 1;
 	case LIST_column:
 		elemtype = TAG_TABLE;
@@ -1009,9 +990,9 @@ mdoc_bd_pre(MDOC_ARGS)
 		 * anyway, so don't sweat it.
 		 */
 		switch (nn->tok) {
-		case MDOC_Sm:
 		case ROFF_br:
-		case MDOC_sp:
+		case ROFF_sp:
+		case MDOC_Sm:
 		case MDOC_Bl:
 		case MDOC_D1:
 		case MDOC_Dl:
@@ -1323,28 +1304,6 @@ mdoc_pp_pre(MDOC_ARGS)
 
 	print_paragraph(h);
 	return 0;
-}
-
-static int
-mdoc_sp_pre(MDOC_ARGS)
-{
-	struct roffsu	 su;
-
-	SCALE_VS_INIT(&su, 1);
-	if (NULL != (n = n->child)) {
-		if ( ! a2roffsu(n->string, &su, SCALE_VS))
-			su.scale = 1.0;
-		else if (su.scale < 0.0)
-			su.scale = 0.0;
-	}
-
-	print_otag(h, TAG_DIV, "suh", &su);
-
-	/* So the div isn't empty: */
-	print_text(h, "\\~");
-
-	return 0;
-
 }
 
 static int