mirror of
https://github.com/pragma-/pbot.git
synced 2025-10-12 05:57:25 +02:00
Remove leading spaces when replacing empty factoid variable
This commit is contained in:
parent
25fd57087e
commit
0193800c1e
@ -481,11 +481,15 @@ sub expand_factoid_vars {
|
|||||||
my $fixed_a = select_indefinite_article $mylist[$line];
|
my $fixed_a = select_indefinite_article $mylist[$line];
|
||||||
$fixed_a = ucfirst $fixed_a if $a =~ m/^A/;
|
$fixed_a = ucfirst $fixed_a if $a =~ m/^A/;
|
||||||
$action =~ s/$a\$$v$modifier/$fixed_a $mylist[$line]/;
|
$action =~ s/$a\$$v$modifier/$fixed_a $mylist[$line]/;
|
||||||
|
} else {
|
||||||
|
if (not length $mylist[$line]) {
|
||||||
|
$action =~ s/\s+\$$v$modifier//;
|
||||||
} else {
|
} else {
|
||||||
$action =~ s/\$$v$modifier/$mylist[$line]/;
|
$action =~ s/\$$v$modifier/$mylist[$line]/;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
last if $matches == 0;
|
last if $matches == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user