diff options
-rw-r--r-- | man.c | 11 | ||||
-rw-r--r-- | mandoc.h | 1 | ||||
-rw-r--r-- | read.c | 1 | ||||
-rw-r--r-- | regress/man/B/Makefile | 8 | ||||
-rw-r--r-- | regress/man/B/blank.in | 9 | ||||
-rw-r--r-- | regress/man/B/blank.out_ascii | 13 | ||||
-rw-r--r-- | regress/man/B/blank.out_lint | 1 | ||||
-rw-r--r-- | regress/man/SH/Makefile | 1 | ||||
-rw-r--r-- | regress/man/SH/noarg.in | 4 | ||||
-rw-r--r-- | regress/man/SH/noarg.out_ascii | 3 | ||||
-rw-r--r-- | regress/man/SH/noarg.out_lint | 1 | ||||
-rw-r--r-- | regress/man/SS/Makefile | 1 | ||||
-rw-r--r-- | regress/man/SS/noarg.in | 4 | ||||
-rw-r--r-- | regress/man/SS/noarg.out_ascii | 3 | ||||
-rw-r--r-- | regress/man/SS/noarg.out_lint | 1 | ||||
-rw-r--r-- | regress/man/TP/Makefile | 1 | ||||
-rw-r--r-- | regress/man/TP/broken.in | 4 | ||||
-rw-r--r-- | regress/man/TP/broken.out_ascii | 2 | ||||
-rw-r--r-- | regress/man/TP/broken.out_lint | 1 |
19 files changed, 63 insertions, 7 deletions
@@ -89,14 +89,15 @@ man_ptext(struct roff_man *man, int line, char *buf, int offs) /* Skip leading whitespace. */ ; /* - * Blank lines are ignored right after headings - * but add a single vertical space elsewhere. + * Blank lines are ignored in next line scope and right + * after headings but add a single vertical space elsewhere. */ if (buf[i] == '\0') { - man_breakscope(man, ROFF_sp); - /* Allocate a blank entry. */ - if (man->last->tok != MAN_SH && + if (man->flags & (MAN_ELINE | MAN_BLINE)) + mandoc_msg(MANDOCERR_BLK_BLANK, man->parse, + line, 0, NULL); + else if (man->last->tok != MAN_SH && man->last->tok != MAN_SS) { roff_elem_alloc(man, line, offs, ROFF_sp); man->next = ROFF_NEXT_SIBLING; @@ -97,6 +97,7 @@ enum mandocerr { MANDOCERR_FI_SKIP, /* fill mode already enabled, skipping: fi */ MANDOCERR_NF_SKIP, /* fill mode already disabled, skipping: nf */ MANDOCERR_BLK_LINE, /* line scope broken: macro breaks macro */ + MANDOCERR_BLK_BLANK, /* skipping blank line in line scope */ /* related to missing arguments */ MANDOCERR_REQ_EMPTY, /* skipping empty request: request */ @@ -139,6 +139,7 @@ static const char * const mandocerrs[MANDOCERR_MAX] = { "fill mode already enabled, skipping", "fill mode already disabled, skipping", "line scope broken", + "skipping blank line in line scope", /* related to missing macro arguments */ "skipping empty request", diff --git a/regress/man/B/Makefile b/regress/man/B/Makefile index 8e4d72a9..0fbecac0 100644 --- a/regress/man/B/Makefile +++ b/regress/man/B/Makefile @@ -1,6 +1,10 @@ # $OpenBSD: Makefile,v 1.1 2014/08/14 02:00:52 schwarze Exp $ -REGRESS_TARGETS = args -LINT_TARGETS = args +REGRESS_TARGETS = args blank +LINT_TARGETS = args blank + +# groff-1.22.3 defect: +# - A blank line in next line scope causes a blank line. +SKIP_GROFF = blank .include <bsd.regress.mk> diff --git a/regress/man/B/blank.in b/regress/man/B/blank.in new file mode 100644 index 00000000..eef5126f --- /dev/null +++ b/regress/man/B/blank.in @@ -0,0 +1,9 @@ +.TH B-BLANK 1 "June 3, 2017" OpenBSD +.SH NAME +B-blank \- blank line in font macro next line scope +.SH DESCRIPTION +A blank line in +.B + +bold +next line scope. diff --git a/regress/man/B/blank.out_ascii b/regress/man/B/blank.out_ascii new file mode 100644 index 00000000..4ecf27d8 --- /dev/null +++ b/regress/man/B/blank.out_ascii @@ -0,0 +1,13 @@ +B-BLANK(1) General Commands Manual B-BLANK(1) + + + +NNAAMMEE + B-blank - blank line in font macro next line scope + +DDEESSCCRRIIPPTTIIOONN + A blank line in bboolldd next line scope. + + + +OpenBSD June 3, 2017 B-BLANK(1) diff --git a/regress/man/B/blank.out_lint b/regress/man/B/blank.out_lint new file mode 100644 index 00000000..22e683ea --- /dev/null +++ b/regress/man/B/blank.out_lint @@ -0,0 +1 @@ +mandoc: blank.in:7:1: WARNING: skipping blank line in line scope diff --git a/regress/man/SH/Makefile b/regress/man/SH/Makefile index f94a4cae..6fff341f 100644 --- a/regress/man/SH/Makefile +++ b/regress/man/SH/Makefile @@ -10,6 +10,7 @@ LINT_TARGETS = broken broken_eline empty_before noarg # - If .HP breaks .SH, a line is broken after the next input line. # - If .RS/RE/nf/fi breaks .SH, the next input line becomes bold. # - .UR does not break .SH. +# - blank line in .SH next line scope causes blank lines and bogus indent SKIP_GROFF = broken broken_eline noarg diff --git a/regress/man/SH/noarg.in b/regress/man/SH/noarg.in index 58ccac7c..087ac834 100644 --- a/regress/man/SH/noarg.in +++ b/regress/man/SH/noarg.in @@ -40,3 +40,7 @@ no-fill mode .SH .fi back in fill mode +.SH + +SEE ALSO +broken(1) diff --git a/regress/man/SH/noarg.out_ascii b/regress/man/SH/noarg.out_ascii index bc3490df..903f85d8 100644 --- a/regress/man/SH/noarg.out_ascii +++ b/regress/man/SH/noarg.out_ascii @@ -27,6 +27,9 @@ DDEESSCCRRIIPPTTIIOONN back in fill mode +SSEEEE AALLSSOO + broken(1) + OpenBSD March 20, 2015 SH-NOARG(1) diff --git a/regress/man/SH/noarg.out_lint b/regress/man/SH/noarg.out_lint index a1bb39b4..3f9d130d 100644 --- a/regress/man/SH/noarg.out_lint +++ b/regress/man/SH/noarg.out_lint @@ -11,3 +11,4 @@ mandoc: noarg.in:31:2: WARNING: line scope broken: UR breaks SH mandoc: noarg.in:34:2: WARNING: line scope broken: UE breaks SH mandoc: noarg.in:35:2: ERROR: skipping end of block that is not open: UE mandoc: noarg.in:41:2: WARNING: fill mode already enabled, skipping: fi +mandoc: noarg.in:44:1: WARNING: skipping blank line in line scope diff --git a/regress/man/SS/Makefile b/regress/man/SS/Makefile index e76a4ee9..01bd7edb 100644 --- a/regress/man/SS/Makefile +++ b/regress/man/SS/Makefile @@ -10,6 +10,7 @@ LINT_TARGETS = broken broken_eline noarg # - If .HP breaks .SS, a line is broken after the next input line. # - If .RS/RE/nf/fi breaks .SS, the next input line becomes bold. # - .UR does not break .SS. +# - blank line in .SS next-line scope causes a blank line SKIP_GROFF = broken broken_eline noarg diff --git a/regress/man/SS/noarg.in b/regress/man/SS/noarg.in index 85470b01..a0ee1059 100644 --- a/regress/man/SS/noarg.in +++ b/regress/man/SS/noarg.in @@ -40,3 +40,7 @@ no-fill mode .SS .fi back in fill mode +.SS + +Subsection +with a blank line diff --git a/regress/man/SS/noarg.out_ascii b/regress/man/SS/noarg.out_ascii index 60fd85ff..20bafc63 100644 --- a/regress/man/SS/noarg.out_ascii +++ b/regress/man/SS/noarg.out_ascii @@ -27,6 +27,9 @@ DDEESSCCRRIIPPTTIIOONN back in fill mode + SSuubbsseeccttiioonn + with a blank line + OpenBSD March 20, 2015 SS-NOARG(1) diff --git a/regress/man/SS/noarg.out_lint b/regress/man/SS/noarg.out_lint index 17151792..8af88544 100644 --- a/regress/man/SS/noarg.out_lint +++ b/regress/man/SS/noarg.out_lint @@ -11,3 +11,4 @@ mandoc: noarg.in:31:2: WARNING: line scope broken: UR breaks SS mandoc: noarg.in:34:2: WARNING: line scope broken: UE breaks SS mandoc: noarg.in:35:2: ERROR: skipping end of block that is not open: UE mandoc: noarg.in:41:2: WARNING: fill mode already enabled, skipping: fi +mandoc: noarg.in:44:1: WARNING: skipping blank line in line scope diff --git a/regress/man/TP/Makefile b/regress/man/TP/Makefile index b867ba63..8d81e954 100644 --- a/regress/man/TP/Makefile +++ b/regress/man/TP/Makefile @@ -8,6 +8,7 @@ LINT_TARGETS = broken double eof # groff-1.22.3 defects: # - If .TP precedes .RE, the latter does not properly reset indentation. # - If the last line of the file is .TP, groff does not print a page footer. +# - A blank line in .TP next line scope causes a blank line. SKIP_GROFF = broken eof diff --git a/regress/man/TP/broken.in b/regress/man/TP/broken.in index c111caeb..5638ea33 100644 --- a/regress/man/TP/broken.in +++ b/regress/man/TP/broken.in @@ -11,3 +11,7 @@ text .RE regular text +.TP + +head +body diff --git a/regress/man/TP/broken.out_ascii b/regress/man/TP/broken.out_ascii index e19efdf0..68fab4f0 100644 --- a/regress/man/TP/broken.out_ascii +++ b/regress/man/TP/broken.out_ascii @@ -10,6 +10,8 @@ DDEESSCCRRIIPPTTIIOONN indented text regular text + head body + OpenBSD December 16, 2014 TP-BROKEN(1) diff --git a/regress/man/TP/broken.out_lint b/regress/man/TP/broken.out_lint index 3a1024fc..1a3a433b 100644 --- a/regress/man/TP/broken.out_lint +++ b/regress/man/TP/broken.out_lint @@ -1 +1,2 @@ mandoc: broken.in:10:2: WARNING: line scope broken: RE breaks TP +mandoc: broken.in:15:1: WARNING: skipping blank line in line scope |