User:AnomieBOT/source/tasks/SourceUploader/Pod.pm: Difference between revisions

Content deleted Content added
AnomieBOT (talk | contribs)
Updating published sources: AnomieBOT::API: * Support HTTP/1.1 Keep-Alive, and use it by default All: * Replace "<code>defined($a)?$a:$b</code>" with "<code>$a // $b</code>" * Replace "<code>exists($a)?$a:$b</code>" with "<code>$a // $b</code>", unle
AnomieBOT (talk | contribs)
Updating published sources: TagDater: * When check_page2 was split from check_page for unit testing purposes, some function calls weren't updated properly so check_page() was getting called with wrong arguments. General: * Apparently @_ holds implicit...
 
(2 intermediate revisions by the same user not shown)
Line 1:
<sourcesyntaxhighlight lang="perl">
package tasks::SourceUploader::Pod;
 
Line 13:
my $class = shift;
my $self = $class->SUPER::new(@_);
$self->encoding( 'utf8' ) if $self->can('encoding');
$self->accept_targets('*');
$self->{'stack'}=[];
Line 47 ⟶ 48:
$s=$s->[$#$s]{'para'};
return unless @$s;
my $txt = $_[0]=~s/\r\n/\n/g;
$_[0]txt=~s/\r\n/\n/g;
$txt=~s->[$#$s].=$_[0]/\r/\n/g;
$s->[$#$s].=$txt;
}
 
Line 85 ⟶ 87:
}
my $text=join("\n\n", @para);
$text=~s/([^\n])\n(?=[a-zA-Z0-9< ])/$1 /g; # unwrap lines
$metadata{'*'}=$text;
$self->{'metadata'}=\%metadata;
Line 113 ⟶ 115:
1;
 
</syntaxhighlight>
</source>