3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-22 20:09:43 +01:00

Interpreter: preserve case of dehighlight

This commit is contained in:
Pragmatic Software 2020-02-06 03:49:33 -08:00
parent c3369f7bea
commit c7c0b49515

View File

@ -925,9 +925,11 @@ sub dehighlight_nicks {
my $zwsp = "\x{200b}";
foreach my $nick (keys %{$nicklist->{$channel}}) {
my $n = quotemeta $nicklist->{$channel}->{$nick}->{nick};
my $n_nh = $nicklist->{$channel}->{$nick}->{nick};
$n_nh =~ s/^(.)/$1$zwsp/;
$line =~ s/$n/$n_nh/gi;
while ($line =~ m/($n)/gi) {
my $match = $1;
$match =~ s/^(.)/$1$zwsp/;
$line =~ s/$n/$match/i;
}
}
return $line;
}