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

Content deleted Content added
AnomieBOT (talk | contribs)
Updating published sources: AFDMergeFromCleaner: * Approved! * Use a link template for the report table, so the various pages have useful links associated. * Bugfix in parsing the report page.
AnomieBOT (talk | contribs)
Updating published sources: AFDMergeFromCleaner: * (Hopefully) Fix line breaking in the report.
Line 169:
$remove{$f}=1;
} else {
$redirected{"$f>$subject>$t"}="| {{$linktmpl|$f}} || {{$linktmpl|$subject}} || {{$linktmpl|$t}} || \n";
}
}
Line 179:
$f=$norm{$f} if exists($norm{$f});
$remove{exists($norm{$f})?$norm{$f}:$f}=1;
$deleted{"$f>$subject"}="| {{$linktmpl|$f}} || {{$linktmpl|$subject}} || \n";
}
}
Line 220:
foreach my $s (split(/(?=(?:^|\n)==)/, $intxt)){
if($s=~/^==\s*Redirected\s*==/){
foreach (split /\n\|-\n/, $s){
next unless /^\Q| {{$linktmpl|\E([^]]+)\Q}} || {{$linktmpl|\E([^]]+)\Q}} || {{$linktmpl|\E([^]]+)\Q}} ||/;
next unless exists($redirected{"$1>$2>$3"});
Line 226:
}
} elsif($s=~/^==\s*Deleted\s*==/){
foreach (split /\n\|-\n/, $s){
next unless /^\Q| {{$linktmpl|\E([^]]+)\Q}} || {{$linktmpl|\E([^]]+)\Q}} ||/;
$deleted{"$1>$2"}=$_;
Line 237:
$outtxt.="! Page !! AFD merge to !! Redirect to !! Note\n";
$outtxt.="|-\n";
$outtxt.=join("\n|-\n", sort values %redirected);
$outtxt.="\n|}\n\n";
$outtxt.="== Deleted ==\n";
$outtxt.="The following table lists deleted pages that were referred to by {{tl|afd-mergefrom}}; the offending {{tl|afd-mergefrom}} has already been removed. Please double-check whether the deletion was correct. If so, just remove the row from the table; if not, undelete the page and restore the {{tl|afd-mergefrom}}. This table will '''not''' be updated automatically.\n\n";
Line 244:
$outtxt.="! Page !! AFD merge to !! Note\n";
$outtxt.="|-\n";
$outtxt.=join("\n|-\n", sort values %deleted);
$outtxt.="\n|}\n\n";
 
if($outtxt ne $intxt){