From 9cc2ea62b7433f3021b78293349ccddded36ce3c Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 16 Jul 2012 09:51:54 +0000 Subject: Several -mdoc parser improvements related to vertical spacing: * So far, .Pp and .Lp were removed before paragraph type blocks. * Now also remove .br before paragraph type blocks. * Treat .Lp as a paragraph like .Pp, so remove .Pp, .Lp, .br before it. * Do not treat .sp as a paragraph, don't remove anything before it. * After .Sh, .Ss, .Pp, and .Lp, remove .Pp, .Lp, .sp, .br, and blank lines. * After .sp and .br, remove .br. OpenBSD rev. mdoc.c 1.89 and mdoc_validate.c 1.106 --- mdoc_man.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mdoc_man.c') diff --git a/mdoc_man.c b/mdoc_man.c index 2673fe4a..8d7cd000 100644 --- a/mdoc_man.c +++ b/mdoc_man.c @@ -1342,7 +1342,10 @@ static int pre_sp(DECL_ARGS) { - print_line(".sp", MMAN_nl); + if (MMAN_PP & outflags && MDOC_It != n->parent->tok) + print_line(".PP", 0); + else + print_line(".sp", 0); return(1); } -- cgit