source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Delete .Pp right before the first .Sh and right before any .Ss,
@ 2017-04-28 16:25 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2017-04-28 16:25 UTC (permalink / raw)
  To: source

Log Message:
-----------
Delete .Pp right before the first .Sh and right before any .Ss,
and warn about it; mdoclint(1) does so, and it makes sense.

Modified Files:
--------------
    mdocml:
        mdoc_validate.c
    mdocml/regress/mdoc/Sh:
        Makefile

Added Files:
-----------
    mdocml/regress/mdoc/Sh:
        first.out_ascii
        parbefore.in
        parbefore.out_ascii
        parbefore.out_lint
        parbefore.out_markdown
        parborder.in
        parborder.out_ascii
        parborder.out_lint
        parborder.out_markdown

Revision Data
-------------
Index: mdoc_validate.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/mdoc_validate.c,v
retrieving revision 1.320
retrieving revision 1.321
diff -Lmdoc_validate.c -Lmdoc_validate.c -u -p -r1.320 -r1.321
--- mdoc_validate.c
+++ mdoc_validate.c
@@ -2015,6 +2015,9 @@ post_ignpar(POST_ARGS)
 	struct roff_node *np;
 
 	switch (mdoc->last->type) {
+	case ROFFT_BLOCK:
+		post_prevpar(mdoc);
+		return;
 	case ROFFT_HEAD:
 		post_hyph(mdoc);
 		return;
--- /dev/null
+++ regress/mdoc/Sh/parborder.out_markdown
@@ -0,0 +1,23 @@
+SH-PARBORDER(1) - General Commands Manual
+
+# NAME
+
+**Sh-parborder** - paragraph macros at the beginning and end of sections
+
+# DESCRIPTION
+
+descriptive text
+
+# EXAMPLES
+
+example text
+
+## Subsection
+
+subsection text
+
+## Another subsection
+
+more subsection text
+
+OpenBSD - April 28, 2017
Index: Makefile
===================================================================
RCS file: /home/cvs/mdocml/mdocml/regress/mdoc/Sh/Makefile,v
retrieving revision 1.3
retrieving revision 1.4
diff -Lregress/mdoc/Sh/Makefile -Lregress/mdoc/Sh/Makefile -u -p -r1.3 -r1.4
--- regress/mdoc/Sh/Makefile
+++ regress/mdoc/Sh/Makefile
@@ -1,11 +1,16 @@
 # $OpenBSD: Makefile,v 1.7 2017/01/08 00:10:22 schwarze Exp $
 
 REGRESS_TARGETS	 = badNAME before empty emptyNAME first nohead order
-REGRESS_TARGETS	+= orderNAME punctNAME subbefore
+REGRESS_TARGETS	+= orderNAME parbefore parborder punctNAME subbefore
 LINT_TARGETS	 = badNAME before empty emptyNAME first nohead order
-LINT_TARGETS	+= orderNAME punctNAME subbefore
+LINT_TARGETS	+= orderNAME parbefore parborder punctNAME subbefore
 
-SKIP_GROFF	= subbefore first empty
-SKIP_ASCII	= first
+# groff-1.22.3 defects:
+# - .Pp before .Sh NAME causes a blank line before the header line
+# - .Ss before .Sh NAME puts the subsection header before the header line
+# - missing .Sh NAME causes loss of the header and footer lines
+# - .Sh DESCRIPTION Xo aborts the parser
+
+SKIP_GROFF	= parbefore subbefore first empty
 
 .include <bsd.regress.mk>
--- /dev/null
+++ regress/mdoc/Sh/parborder.in
@@ -0,0 +1,21 @@
+.Dd April 28, 2017
+.Dt SH-PARBORDER 1
+.Os OpenBSD
+.Sh NAME
+.Nm Sh-parborder
+.Nd paragraph macros at the beginning and end of sections
+.Sh DESCRIPTION
+.Pp
+descriptive text
+.Pp
+.Sh EXAMPLES
+.Pp
+example text
+.Pp
+.Ss Subsection
+.Pp
+subsection text
+.Pp
+.Ss Another subsection
+more subsection text
+.Pp
--- /dev/null
+++ regress/mdoc/Sh/parbefore.in
@@ -0,0 +1,9 @@
+.Dd April 28, 2017
+.Dt SH-PARBEFORE 1
+.Os OpenBSD
+.Pp
+.Sh NAME
+.Nm Sh-parbefore
+.Nd paragraph macro before the first section header
+.Sh DESCRIPTION
+some text
--- /dev/null
+++ regress/mdoc/Sh/first.out_ascii
@@ -0,0 +1,6 @@
+SH-FIRST(1)                 General Commands Manual                SH-FIRST(1)
+
+D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
+     The first section is not a NAME section.
+
+OpenBSD                          July 1, 2014                          OpenBSD
--- /dev/null
+++ regress/mdoc/Sh/parborder.out_lint
@@ -0,0 +1,7 @@
+mandoc: parborder.in:8:2: WARNING: skipping paragraph macro: Pp after Sh
+mandoc: parborder.in:10:2: WARNING: skipping paragraph macro: Pp at the end of Sh
+mandoc: parborder.in:12:2: WARNING: skipping paragraph macro: Pp after Sh
+mandoc: parborder.in:16:2: WARNING: skipping paragraph macro: Pp after Ss
+mandoc: parborder.in:18:2: WARNING: skipping paragraph macro: Pp at the end of Ss
+mandoc: parborder.in:14:2: WARNING: skipping paragraph macro: Pp before Ss
+mandoc: parborder.in:21:2: WARNING: skipping paragraph macro: Pp at the end of Ss
--- /dev/null
+++ regress/mdoc/Sh/parborder.out_ascii
@@ -0,0 +1,18 @@
+SH-PARBORDER(1)             General Commands Manual            SH-PARBORDER(1)
+
+N\bNA\bAM\bME\bE
+     S\bSh\bh-\b-p\bpa\bar\brb\bbo\bor\brd\bde\ber\br - paragraph macros at the beginning and end of sections
+
+D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
+     descriptive text
+
+E\bEX\bXA\bAM\bMP\bPL\bLE\bES\bS
+     example text
+
+   S\bSu\bub\bbs\bse\bec\bct\bti\bio\bon\bn
+     subsection text
+
+   A\bAn\bno\bot\bth\bhe\ber\br s\bsu\bub\bbs\bse\bec\bct\bti\bio\bon\bn
+     more subsection text
+
+OpenBSD                         April 28, 2017                         OpenBSD
--- /dev/null
+++ regress/mdoc/Sh/parbefore.out_ascii
@@ -0,0 +1,9 @@
+SH-PARBEFORE(1)             General Commands Manual            SH-PARBEFORE(1)
+
+N\bNA\bAM\bME\bE
+     S\bSh\bh-\b-p\bpa\bar\brb\bbe\bef\bfo\bor\bre\be - paragraph macro before the first section header
+
+D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
+     some text
+
+OpenBSD                         April 28, 2017                         OpenBSD
--- /dev/null
+++ regress/mdoc/Sh/parbefore.out_lint
@@ -0,0 +1 @@
+mandoc: parbefore.in:4:2: WARNING: skipping paragraph macro: Pp before Sh
--- /dev/null
+++ regress/mdoc/Sh/parbefore.out_markdown
@@ -0,0 +1,11 @@
+SH-PARBEFORE(1) - General Commands Manual
+
+# NAME
+
+**Sh-parbefore** - paragraph macro before the first section header
+
+# DESCRIPTION
+
+some text
+
+OpenBSD - April 28, 2017
--
 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:[~2017-04-28 16:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-28 16:25 mdocml: Delete .Pp right before the first .Sh and right before any .Ss, 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).