source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Fix vertical spacing at the beginning of tables.
@ 2015-03-06 15:49 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2015-03-06 15:49 UTC (permalink / raw)
  To: source

Log Message:
-----------
Fix vertical spacing at the beginning of tables.
man(7) always prints a blank line, mdoc(7) doesn't.
Problem in mdoc(7) reported by kristaps@.
mdoc(7) part of the patch tested by kristaps@.

Modified Files:
--------------
    mdocml:
        man_term.c
        mdoc_term.c
        tbl_term.c

Revision Data
-------------
Index: man_term.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/man_term.c,v
retrieving revision 1.168
retrieving revision 1.169
diff -Lman_term.c -Lman_term.c -u -p -r1.168 -r1.169
--- man_term.c
+++ man_term.c
@@ -945,12 +945,8 @@ print_man_node(DECL_ARGS)
 			p->flags |= TERMP_NOSPACE;
 		return;
 	case MAN_TBL:
-		/*
-		 * Tables are preceded by a newline.  Then process a
-		 * table line, which will cause line termination,
-		 */
-		if (n->span->prev == NULL)
-			term_newln(p);
+		if (p->tbl.cols == NULL)
+			term_vspace(p);
 		term_tbl(p, n->span);
 		return;
 	default:
Index: tbl_term.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/tbl_term.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -Ltbl_term.c -Ltbl_term.c -u -p -r1.39 -r1.40
--- tbl_term.c
+++ tbl_term.c
@@ -66,9 +66,6 @@ term_tbl(struct termp *tp, const struct 
 	size_t			 rmargin, maxrmargin, tsz;
 	int			 ic, horiz, spans, vert;
 
-	if (tp->tbl.cols == NULL)
-		term_flushln(tp);
-
 	rmargin = tp->rmargin;
 	maxrmargin = tp->maxrmargin;
 
Index: mdoc_term.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/mdoc_term.c,v
retrieving revision 1.312
retrieving revision 1.313
diff -Lmdoc_term.c -Lmdoc_term.c -u -p -r1.312 -r1.313
--- mdoc_term.c
+++ mdoc_term.c
@@ -348,6 +348,8 @@ print_mdoc_node(DECL_ARGS)
 			p->flags |= TERMP_NOSPACE;
 		break;
 	case MDOC_TBL:
+		if (p->tbl.cols == NULL)
+			term_newln(p);
 		term_tbl(p, n->span);
 		break;
 	default:
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

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

only message in thread, other threads:[~2015-03-06 15:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-06 15:49 mdocml: Fix vertical spacing at the beginning of tables 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).