summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-07-19 11:06:31 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-07-19 11:06:31 +0000
commitf90057424895469777005ec5e8c4af9179e7ad87 (patch)
tree3d50417607e59224795ff93c5f97196648d60589
parent9f12a090a011ed1b08b0e969623369c17f095a21 (diff)
downloadmandoc-f90057424895469777005ec5e8c4af9179e7ad87.tar.gz
mandoc-f90057424895469777005ec5e8c4af9179e7ad87.tar.zst
mandoc-f90057424895469777005ec5e8c4af9179e7ad87.zip
Fix spurrious newline emitted by `Pp' when specified before or after
`Sh'/`Ss'. Reported by Jason McIntyre.
-rw-r--r--TODO5
-rw-r--r--mdoc_html.c7
-rw-r--r--mdoc_term.c7
3 files changed, 13 insertions, 6 deletions
diff --git a/TODO b/TODO
index 738aba66..33a9d9fa 100644
--- a/TODO
+++ b/TODO
@@ -1,6 +1,6 @@
************************************************************************
* Official mandoc TODO. May not be quite up to date.
-* $Id: TODO,v 1.31 2010/07/19 09:21:58 kristaps Exp $
+* $Id: TODO,v 1.32 2010/07/19 11:06:31 kristaps Exp $
************************************************************************
************************************************************************
@@ -74,9 +74,6 @@
try e.g. .Bl -column It Ta Ta
reported by millert Fri, 02 Apr 2010 16:13:46 -0400
-- .Pp before and after .Sh (and .Ss) produces a spurious blank line;
- reported by jmc@ Thu, 15 Jul 2010 23:00:28 +0100
-
************************************************************************
* formatting issues: gratuitious differences
************************************************************************
diff --git a/mdoc_html.c b/mdoc_html.c
index 59c63d3a..c7dbfea0 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_html.c,v 1.96 2010/07/13 23:53:20 schwarze Exp $ */
+/* $Id: mdoc_html.c,v 1.97 2010/07/19 11:06:31 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -1737,6 +1737,11 @@ mdoc_sp_pre(MDOC_ARGS)
len = 0;
break;
default:
+ assert(n->parent);
+ if ((NULL == n->next || NULL == n->prev) &&
+ (MDOC_Ss == n->parent->tok ||
+ MDOC_Sh == n->parent->tok))
+ return(0);
len = 1;
break;
}
diff --git a/mdoc_term.c b/mdoc_term.c
index 0755b164..d5bd775d 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_term.c,v 1.174 2010/07/16 00:03:37 schwarze Exp $ */
+/* $Id: mdoc_term.c,v 1.175 2010/07/19 11:06:31 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -1905,6 +1905,11 @@ termp_sp_pre(DECL_ARGS)
len = 0;
break;
default:
+ assert(n->parent);
+ if ((NULL == n->next || NULL == n->prev) &&
+ (MDOC_Ss == n->parent->tok ||
+ MDOC_Sh == n->parent->tok))
+ return(0);
len = 1;
break;
}