3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-26 13:59:47 +01:00

Interpreter: do not dehighlight nicks that are followed by a colon

This commit is contained in:
Pragmatic Software 2020-02-08 14:42:20 -08:00
parent 30494e54b2
commit 525b2ee056

View File

@ -912,10 +912,10 @@ sub dehighlight_nicks {
foreach my $nick (@nicks) {
$nick = quotemeta $nick;
my $const_line = $line;
while ($const_line =~ m/(?<![^\W_])($nick)(?![^\W_])/gi) {
while ($const_line =~ m/(?<![^\W_])($nick)(?![^\W_:])/gi) {
my $match = $1;
$match =~ s/^(.)/$1\x{200b}/;
$line =~ s/$nick/$match/i;
$line =~ s/$nick(?!:)/$match/i;
}
}
return $line;