mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
dev: improvements to gen-list-unimplemented-cards-for-set.pl (#14308)
* Handle colons and ampersands in card names * URL encode ampersands to prevent them being handled as GET parameters in card names
This commit is contained in:
parent
1208785d78
commit
cc224c1bad
1 changed files with 5 additions and 2 deletions
|
|
@ -82,7 +82,8 @@ sub cardSort {
|
|||
sub toCamelCase {
|
||||
my $string = $_[0];
|
||||
$string =~ s/\b([\w']+)\b/ucfirst($1)/ge;
|
||||
$string =~ s/[-,\s\'\.!@#*\(\)]//g;
|
||||
$string =~ s/[-,\s\'\.!@#*:\(\)]//g;
|
||||
$string =~ s/\&/And/g;
|
||||
$string;
|
||||
}
|
||||
|
||||
|
|
@ -116,6 +117,7 @@ foreach my $card (sort cardSort @setCards) {
|
|||
my $currentFileName = "../Mage.Sets/src/mage/cards/" . lc(substr($className, 0, 1)) . "/" . $className . ".java";
|
||||
my $cardNameForUrl = $cardName;
|
||||
$cardNameForUrl =~ s/ //g;
|
||||
$cardNameForUrl =~ s/\&/%26/g; # URL encode ampersands
|
||||
my $cardEntry = "- [ ] In progress -- [$cardName](https://scryfall.com/search?q=!\"$cardNameForUrl\" e:$setAbbr)";
|
||||
|
||||
if(-e $currentFileName) {
|
||||
|
|
@ -138,6 +140,7 @@ foreach my $cardName (sort keys %cardNames) {
|
|||
my $urlCardName = $cardName;
|
||||
$urlCardName =~ s/ //g;
|
||||
$urlCardName =~ s/"/\\"/g; # Escape quotes
|
||||
$urlCardName =~ s/\&/%26/g; # URL encode ampersands
|
||||
push(@unimplementedNames, "!\"$urlCardName\"");
|
||||
}
|
||||
}
|
||||
|
|
@ -158,4 +161,4 @@ close(OUTPUT);
|
|||
|
||||
print "Issue tracker generated: $outputFile\n";
|
||||
print "Implemented cards: " . scalar(@implementedCards) . "\n";
|
||||
print "Unimplemented cards: " . scalar(@unimplementedCards) . "\n";
|
||||
print "Unimplemented cards: " . scalar(@unimplementedCards) . "\n";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue