mirror of
https://github.com/pragma-/pbot.git
synced 2025-02-17 05:50:56 +01:00
Interpreter: do not dehighlight nicks that are followed by a colon
This commit is contained in:
parent
30494e54b2
commit
525b2ee056
@ -912,10 +912,10 @@ sub dehighlight_nicks {
|
|||||||
foreach my $nick (@nicks) {
|
foreach my $nick (@nicks) {
|
||||||
$nick = quotemeta $nick;
|
$nick = quotemeta $nick;
|
||||||
my $const_line = $line;
|
my $const_line = $line;
|
||||||
while ($const_line =~ m/(?<![^\W_])($nick)(?![^\W_])/gi) {
|
while ($const_line =~ m/(?<![^\W_])($nick)(?![^\W_:])/gi) {
|
||||||
my $match = $1;
|
my $match = $1;
|
||||||
$match =~ s/^(.)/$1\x{200b}/;
|
$match =~ s/^(.)/$1\x{200b}/;
|
||||||
$line =~ s/$nick/$match/i;
|
$line =~ s/$nick(?!:)/$match/i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $line;
|
return $line;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user