User:AnomieBOT/source/tasks/AFDMergeFromCleaner.pm: Difference between revisions

Content deleted Content added
AnomieBOT (talk | contribs)
Updating published sources: IFDCloser: * s/Image_name.ext/File_name.ext/ to match documentation change.
AnomieBOT (talk | contribs)
Updating published sources: AFDMergeFromCleaner: * A little whitespace adjustment. * Use {{tl|afd-merged-from}}
Line 178:
my $f=$_->{'title'};
$f=$norm{$f} if exists($norm{$f});
$remove{exists($norm{$f})?$norm{$f}:$f}=12;
$deleted{"$f>$subject"}="| {{$linktmpl|$f}} || {{$linktmpl|$subject}} || ";
}
Line 185:
# Remove the removable templates
my $outtxt=$self->process_templates($intxt, sub {
returnmy undef unless exists($templates{'Template:'.$_[0]})name=shift;
my @params=@{shift()};
shift; # $wikitext
shift; # $data
my $oname=shift;
 
return undef unless exists($templates{'Template:'.$name});
my $f=undef;
foreach ($self->process_paramlist(@{$_[1]}params)){
($f=$_->{'value'})=~s/^\s+|\s+$//g if $_->{'name'} eq 1;
}
return undef unless exists($remove{$f})?'':undef;
return '' if $remove{$f}==2;
$oname=~s/_/ /g;
$oname=~s/^(\s*)\S(?:.*\S)?(\s*)$/${1}afd-merged-from$2/is;
return "{{$oname|".join("|",@params)."}}";
});
 
Line 223 ⟶ 233:
$s=~s/\|}.*$//s;
foreach (split /\n\|-\n/, $s){
s/[\r\n]\s*$//;
next unless /^\Q| {{$linktmpl|\E([^]]+)\Q}} || {{$linktmpl|\E([^]]+)\Q}} || {{$linktmpl|\E([^]]+)\Q}} ||/;
next unless exists($redirected{"$1>$2>$3"});
Line 230 ⟶ 241:
$s=~s/\|}.*$//s;
foreach (split /\n\|-\n/, $s){
s/[\r\n]\s*$//;
next unless /^\Q| {{$linktmpl|\E([^]]+)\Q}} || {{$linktmpl|\E([^]]+)\Q}} ||/;
$deleted{"$1>$2"}=$_;