Interpreter: preserve case of dehighlight

This commit is contained in:
Pragmatic Software 2020-02-06 03:49:33 -08:00
parent c3369f7bea
commit c7c0b49515
1 changed files with 5 additions and 3 deletions

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;
}