In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/d6150e10749d85cf1797627bdf8cf9a86cd8d6e6?hp=dcce18ed6762e08c06a49389b78d8c6468c95dfd>
- Log ----------------------------------------------------------------- commit d6150e10749d85cf1797627bdf8cf9a86cd8d6e6 Author: Dagfinn Ilmari MannsÃ¥ker <ilm...@ilmari.org> Date: Mon Sep 11 16:55:17 2017 +0100 Check for Unicode replacement character in t/porting/podcheck.t Pod::Simple replaces bytes that aren't valid according to the document's encoding (declared or auto-detected) \N{REPLACEMENT CHARACTER}, so catch that. M t/porting/podcheck.t commit 20475dd43595fc875334c67bd2e1cb13aa21159a Author: Dagfinn Ilmari MannsÃ¥ker <ilm...@ilmari.org> Date: Mon Sep 11 16:51:28 2017 +0100 Fix misplaced =back in t/porting/podcheck.t The list of pedantic checks was mistakenly nested inside the last mandatory check. M t/porting/podcheck.t commit 8d1c7d0a38e3ac54307661eb111c22edcc597606 Author: Dagfinn Ilmari MannsÃ¥ker <ilm...@ilmari.org> Date: Mon Sep 11 16:53:50 2017 +0100 Fix Windows-1252 em-dashes in latest epigraphs M Porting/epigraphs.pod ----------------------------------------------------------------------- Summary of changes: Porting/epigraphs.pod | 6 +++--- t/porting/podcheck.t | 20 ++++++++++++++++++-- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/Porting/epigraphs.pod b/Porting/epigraphs.pod index b4f62a04f7..7d2acb7c3a 100644 --- a/Porting/epigraphs.pod +++ b/Porting/epigraphs.pod @@ -124,8 +124,8 @@ L<Announced on 2017-09-10 by Steve Hay|http://www.nntp.perl.org/group/perl.perl5 Glimmered the white Moon-shine.' 'God save thee, ancient Mariner! - From the fiends, that plague thee thus!- - Why look'st thou so?'-With my cross-bow + From the fiends, that plague thee thus!â + Why look'st thou so?'âWith my cross-bow I shot the ALBATROSS. =head2 v5.26.0 - Nine Simone, Ain't Got No / I Got Life @@ -395,7 +395,7 @@ L<Announced on 2017-09-10 by Steve Hay|http://www.nntp.perl.org/group/perl.perl5 And through the drifts the snowy clifts Did send a dismal sheen: - Nor shapes of men nor beasts we ken- + Nor shapes of men nor beasts we kenâ The ice was all between. The ice was here, the ice was there, diff --git a/t/porting/podcheck.t b/t/porting/podcheck.t index cb2976e57f..9b314a1f6c 100644 --- a/t/porting/podcheck.t +++ b/t/porting/podcheck.t @@ -93,6 +93,13 @@ missing from the C<LE<lt>E<gt>> pod command. A pod can't be linked to unless it has a unique name. And a NAME should have a dash and short description after it. +=item Occurrences of the Unicode replacement character + +L<Pod::Simple> replaces bytes that aren't valid according to the document's +encoding (declared or auto-detected) with C<\N{REPLACEMENT CHARACTER}>. + +=back + If the C<PERL_POD_PEDANTIC> environment variable is set or the C<--pedantic> command line argument is provided then a few more checks are made. The pedantic checks are: @@ -155,8 +162,6 @@ Another problem is that there is currently no check that modules listed as valid in the database actually are. Thus any errors introduced there will remain there. -=back - =head2 Specially handled pods =over @@ -361,6 +366,7 @@ my $multiple_targets = "There is more than one target"; my $duplicate_name = "Pod NAME already used"; my $no_name = "There is no NAME"; my $missing_name_description = "The NAME should have a dash and short description after it"; +my $replacement_character = "Unicode replacement character found"; # the pedantic warnings messages my $line_length = "Verbatim line length including indents exceeds $MAX_LINE_LENGTH by"; my $C_not_linked = "? Should you be using L<...> instead of"; @@ -853,6 +859,16 @@ package My::Pod::Checker { # Extend Pod::Checker $running_CFL_text{$addr} .= $text; } + # do this line-by-line so we can get the right line number + my @lines = split /^/, $running_simple_text{$addr}; + for my $i (0..$#lines) { + if ($lines[$i] =~ m/\N{REPLACEMENT CHARACTER}/) { + $self->poderror({ -line => $start_line{$addr} + $i, + -msg => $replacement_character, + parameter => "possibly invalid ". $self->encoding . " input at character " . pos $lines[$i], + }); + } + } return $return; } -- Perl5 Master Repository