diff options
author | Roderick Schertler <roderick@argon.org> | 1997-10-24 07:20:44 -0400 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-03-04 01:25:50 +0000 |
commit | 2862e1b7fc64694815faab42fc50219a12dae9f0 (patch) | |
tree | 5688682710cd864b39895ec07ae5119acb7eda2f /pod/checkpods.PL | |
parent | 94d4f21ce5099f301ed168bfe5ebf5e185d03459 (diff) | |
download | perl-2862e1b7fc64694815faab42fc50219a12dae9f0.tar.gz |
[win32] maintpatch
#70: "Fix random whitespace errors in docs"
Msg-ID: <12726.877706444@eeyore.ibcinc.com>
Files: pod/checkpods.PL pod/perlfunc.pod
p4raw-id: //depot/win32/perl@724
Diffstat (limited to 'pod/checkpods.PL')
-rw-r--r-- | pod/checkpods.PL | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/pod/checkpods.PL b/pod/checkpods.PL index ccd78ec9cf..0cac62325e 100644 --- a/pod/checkpods.PL +++ b/pod/checkpods.PL @@ -37,7 +37,7 @@ print OUT <<'!NO!SUBS!'; # From: Roderick Schertler <roderick@gate.net> # To: perl5-porters@africa.nicoh.com # Subject: POD lines with only spaces -# +# # There are some places in the documentation where a POD directive is # ignored because the line before it contains whitespace (and so the # directive doesn't start a paragraph). This patch adds a way to check @@ -53,18 +53,25 @@ print OUT <<'!NO!SUBS!'; # to grow. Someone will probably want to rewrite in terms of # some sort of Pod::Checker module. Or something. Consider this # a placeholder for the future. -$exit = $last_blank = 0; +# Version 1.02 Roderick Schertler <roderick@argon.org> +# Check for pod directives following any kind of unempty line, not +# just lines of whitespace. + +@directive = qw(head1 head2 item over back cut pod for begin end); +@directive{@directive} = (1) x @directive; + +$exit = $last_unempty = 0; while (<>) { - chop; - if (/^(=\S+)/ && $last_blank) { - printf "%s: line %5d, Non-empty line preceeding directive %s\n", + chomp; + if (/^=(\S+)/ && $directive{$1} && $last_unempty) { + printf "%s: line %5d, no blank line preceeding directive =%s\n", $ARGV, $., $1; $exit = 1; } - $last_blank = /^\s+$/; + $last_unempty = ($_ ne ''); if (eof) { close(ARGV); - $last_blank = 0; + $last_unempty = 0; } } exit $exit |