Skip to content

Commit 3c6cd8b

Browse files
committed
t/porting/podcheck.t: allow ' in English words
podcheck.t uses a crude heuristic to identify links that use the wrong POD syntax (e.g. C<Some::Module> instead of L<Some::Module>): It checks whether the word before the C<...> markup was "see". This has the potential for a lot of false positives, so it adds an additional check: If the words before "see" include the word "you", we don't count it as a link attempt. This is to rule out cases like "you may see C<mtfnpy> in the output". However, that heuristic failed on this example from perlport: on Unix you'll see C<"a."> This is because ' is not a word character, so the leading context was just "ll", which doesn't contain "you": not ok 241 - POD of pod/perlport.pod # "? Should you be using L<...> instead of" # C<"a."> near line 1104 of pod/perlport.pod This patch teaches podcheck.t about common English short forms such as "you'll", "you're", or "you'd".
1 parent b01c26f commit 3c6cd8b

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

t/porting/podcheck.t

+9-9
Original file line numberDiff line numberDiff line change
@@ -1034,15 +1034,15 @@ package My::Pod::Checker { # Extend Pod::Checker
10341034
return unless defined $running_CFL_text{$addr};
10351035
10361036
while ($running_CFL_text{$addr} =~ m{
1037-
( (?: \w+ \s+ )* ) # The phrase before, if any
1038-
\b [Ss]ee \s+
1039-
( ( [^L] )
1040-
<
1041-
( [^<]*? ) # The not < excludes nested C<L<...
1042-
>
1043-
)
1044-
( \s+ (?: under | in ) \s+ L< )?
1045-
}xg)
1037+
( (?: \w+ (?: ' (?: d | ll | m | re | s | ve ) )? \s+ )* ) # The phrase before, if any
1038+
\b [Ss]ee \s+
1039+
( ( [^L] )
1040+
<
1041+
( [^<]*? ) # The not < excludes nested C<L<...
1042+
>
1043+
)
1044+
( \s+ (?: under | in ) \s+ L< )?
1045+
}xg)
10461046
{
10471047
my $prefix = $1 // "";
10481048
my $construct = $2; # The whole thing, like C<...>

0 commit comments

Comments
 (0)