summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2015-03-20 14:47:21 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2015-03-20 14:47:21 +0000
commitb83737985f18dfc1026466bec9e1aee019570a19 (patch)
tree68d2db1c297a4ce8d9921a440c187592acebdde0
parent7b215b885573835e4d2ba1dcdbd3fb9fb91fac98 (diff)
The .PD macro can occur in next-line scope. Fixes zshmisc(1).
Issue reported by Christian Neukirchen <chneukirchen at gmail dot com>.
-rw-r--r--regress/usr.bin/mandoc/man/PD/Makefile4
-rw-r--r--regress/usr.bin/mandoc/man/PD/nextline.in42
-rw-r--r--regress/usr.bin/mandoc/man/PD/nextline.out_ascii33
-rw-r--r--usr.bin/mandoc/man_macro.c4
4 files changed, 79 insertions, 4 deletions
diff --git a/regress/usr.bin/mandoc/man/PD/Makefile b/regress/usr.bin/mandoc/man/PD/Makefile
index 86e5d910552..049cbec41f4 100644
--- a/regress/usr.bin/mandoc/man/PD/Makefile
+++ b/regress/usr.bin/mandoc/man/PD/Makefile
@@ -1,6 +1,6 @@
-# $OpenBSD: Makefile,v 1.2 2015/02/06 09:38:22 schwarze Exp $
+# $OpenBSD: Makefile,v 1.3 2015/03/20 14:47:20 schwarze Exp $
-REGRESS_TARGETS = spacing args
+REGRESS_TARGETS = args nextline spacing
LINT_TARGETS = args
.include <bsd.regress.mk>
diff --git a/regress/usr.bin/mandoc/man/PD/nextline.in b/regress/usr.bin/mandoc/man/PD/nextline.in
new file mode 100644
index 00000000000..a417f9d82be
--- /dev/null
+++ b/regress/usr.bin/mandoc/man/PD/nextline.in
@@ -0,0 +1,42 @@
+.TH PD-NEXTLINE 1 "March 20, 2015" OpenBSD
+.SH NAME
+PD-nextline \- paragraph distance macro in next-line scope
+.SH DESCRIPTION
+some text
+.SH
+.PD 0v
+NEXT SECTION
+first paragraph
+.PP
+second paragraph
+.PD 1v
+.PP
+third paragraph
+.SS
+.PD 0v
+Subsection
+first paragraph
+.PP
+second paragraph
+.PD 1v
+.PP
+third paragraph
+.TP 6n
+.PD 0v
+tag
+list text
+.TP
+tag
+list text
+.PD 1v
+.TP
+tag
+list text
+.PP
+normal text
+.B
+.PD 0v
+bold text
+normal text
+.PP
+final paragraph
diff --git a/regress/usr.bin/mandoc/man/PD/nextline.out_ascii b/regress/usr.bin/mandoc/man/PD/nextline.out_ascii
new file mode 100644
index 00000000000..f0e7332643f
--- /dev/null
+++ b/regress/usr.bin/mandoc/man/PD/nextline.out_ascii
@@ -0,0 +1,33 @@
+PD-NEXTLINE(1) General Commands Manual PD-NEXTLINE(1)
+
+
+
+NNAAMMEE
+ PD-nextline - paragraph distance macro in next-line scope
+
+DDEESSCCRRIIPPTTIIOONN
+ some text
+
+NNEEXXTT SSEECCTTIIOONN
+ first paragraph
+ second paragraph
+
+ third paragraph
+
+ SSuubbsseeccttiioonn
+ first paragraph
+ second paragraph
+
+ third paragraph
+
+ tag list text
+ tag list text
+
+ tag list text
+
+ normal text bboolldd tteexxtt normal text
+ final paragraph
+
+
+
+OpenBSD March 20, 2015 PD-NEXTLINE(1)
diff --git a/usr.bin/mandoc/man_macro.c b/usr.bin/mandoc/man_macro.c
index e1ae33e8120..071959a602b 100644
--- a/usr.bin/mandoc/man_macro.c
+++ b/usr.bin/mandoc/man_macro.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: man_macro.c,v 1.61 2015/03/20 12:53:43 schwarze Exp $ */
+/* $OpenBSD: man_macro.c,v 1.62 2015/03/20 14:47:20 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2012, 2013, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -77,7 +77,7 @@ const struct man_macro __man_macros[MAN_MAX] = {
{ blk_exp, MAN_BSCOPE }, /* RS */
{ in_line_eoln, 0 }, /* DT */
{ in_line_eoln, 0 }, /* UC */
- { in_line_eoln, 0 }, /* PD */
+ { in_line_eoln, MAN_NSCOPED }, /* PD */
{ in_line_eoln, 0 }, /* AT */
{ in_line_eoln, 0 }, /* in */
{ in_line_eoln, 0 }, /* ft */